]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 months agoMerge tag 'iio-for-6.13a-take2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Sat, 19 Oct 2024 07:33:36 +0000 (09:33 +0200)]
Merge tag 'iio-for-6.13a-take2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next

Jonathan writes:

IIO: 1st set of new device support, features and cleanup for 6.13

Changes in take2:
- Additional patch to drop the accidentally added empty file.
- Tidy up of a duplicate include.

Two merges of other trees.

6.12-rc2:
To pull in the move of unaligned.h from include/asm to include/linux
This was to resolve issues in linux-next.

pwm/duty_offset-for6.13-rc1@
PWM infrastructure that is use di the AD7625 ADC driver.

New device support
==================

adi,ad7173
- Add support for the AD4113 8 channel ADC.
adi,ad7606
- Add support for the AD7606C-16 and AD7606C-18 which have higher precision
  and support bipolar and differential channels. A lot of driver
  rework was needed to add the additional flexibility needed to support
  these parts.
adi,ad7625
- New driver supporting AD7625, AD7626, AD7960 and AD7961 LVDS connected
  ADCs. Interface uses a combination of a PWM control and an IIO backend
  (currently a custom FPGA IP).
adi,ad8460
- New driver for the ad8460 Waveform DAC. This high speed device is
  driven by a custom IP via a DMAEngine buffer.
bosch,bmi270
- New driver for this 6-axis IMU. A later patch adds SPI support.
gehc,pmc-adc
- New driver for this GE Healthcare ADC 16-channel 16 bit ADC.
invensense,mpu6050
- Add support for IAM-20680HT and IAM-20680HP variants of the IAM-20680
  IMU that have better specifications in various ways including larger
  FIFO sizes.
vishay,vl6030
- Support the veml7700, a stripped down veml6030 ambient light sensor.
- Support the veml6035 ambient light sensor.

Features
========

liteon,ltr390
- Allow configuration of sampling frequency
- Support suspend and resume
- Add interrupt support including threshold events + control over
  event reporting persistence.
st,vl53l0x
- Add support for continuous mode via IIO buffer support and a dataready
  trigger.
ti,tmp0006
- Add triggered buffer support using data ready interrupt.
vishay,vl6030
- Add regulator control support.
vishay,vl6070
- Add regulator control support.
vishay,vl6180
- Allow configuration of waiting between continuous samples.
- Use the interrupt, if available, for single shot captures
- Support continuous mode via the IIO triggered buffer interfaces.

Cleanups and minor fixes
========================

tools/event monitor
- Free dev_dir_name.
treewide
- Introduce aligned_s64 type for timestamps to replace
  s64 __aligned(8). Initial use in a few drivers - many others to follow.
- Use dev_get_platform_data() instead of open-coding the access.
- InvenSense email address and maintainer updates to reflect
  move to the tdk domain after acquisition.
- Switch platform drivers from remove_new() back to remove() now all
  rework this was enabling is done.
- More use of device_for_each_child_node_scoped() to remove need for manual
  caling of fwnode_handle_put() in early exits from the loop.
- Use IIO_MAP() macro to replace some open-coded versions.
- Constify struct iio_map arrays.
- Use irq_get_trigger_type(irq) rather than
  irqd_get_trigger_type(irq_get_irq_data(irq);
core
- unsigned to unsigned int.
adi,ad3552r
- Fix to low a limit on max SPI clock speed. No rush to upstream this
  one as the binding that uses the higher speed will merge via this
  tree once ready.
adi,ad5770r
- Use get_unaligned_le16() instead of open-coding. Note this caused
  a merge issue in linux-next as unaligned.h has moved.
adi,ad7606
- Use read_avail() callback to handle the various _available attributes.
- Wrap up all data related to channel scaling into a single structure as
  the use of this gets more complex for the -16 and -18 parts.
adi,adf4371
- Use chip_info structures and spi_get_device_match_data()
- Drop spi_set_drvdata() as unused.
- Reduce scope of struct clock as only touched in probe().
- Use dev_err_probe() where appropriate.
adi,axi-dac
- Improve register naming to make field and register association clearer.
- Fix a wrong register bit.
amlogic,meson8-saradc
- Allow the meson8-saradc to have the amlogic,hhi-sysctrl property.
bosch,bmp280
- Use u8 for the DMA buffer to avoid implication of other types given it
  can contain be24 data.
- Use unsigned types to store raw values to make it clear they cannot be
  negative.
- Drop unnecessary check for errors after IIR filter update.
- Support soft reset to get device to know state on driver load.
- Use bulk reads to retrieve the humidity calibration data.
dynaimage,al3010
- Make sure to powerdown device in error paths.
invensense,icm42600
- Add missing i2c_device-id tables.
kionix,kmx61
- Drop ACPI IDs that are not associated with valid ACPI vendor IDs
  and for which there is no evidence they are in use in real devices.
liteon,ltrf261a
- Document a bad compatible that we are supporting because it is in
  the wild in the Valve Steam Deck via ACPI PRP0001.
maxim,max1363
- Use get_unaligned_be16() instead of open-coding. Note this caused
  a merge issue in linux-next as unaligned.h has moved.
mediatek,mt6360
- Use get_unaligned_be16() instead of open-coding. Note this caused
  a merge issue in linux-next as unaligned.h has moved.
microchip,pac1921
- Drop various unnecessary type casts that were suggested by
  Wconversion compiler warnings which we do not use in IIO.
  Remove them because they hurt readability in cases where it is clear
  not overflow can occur.
rohm,rpr0521
- Use iio_poll_func_store_time() rather than open-coding a similar solution.
semtech,sx9324
- Make sx_common_get_raw_register() local to the only code that uses it.
- Drop unnecessary acpi.h include.
st,vl53l0x
- Check the part ID register and print an info message if it is not what
  is expected.
vishay,veml6030
- Fix DT binding file name to include vishay
- Use regmap_set_bits() for case where all bits are set.
- Use dev_err_probe() where appropriate.
- Add missing delay after powering up in resume path.
- Drop a processed accessor for the white channel as there is no public
  information to allow a specific scale to be established.
- Use read_avail() to replace explicit custom _available attributes.
vishay,veml6070
- Use guard() to allow early returns.
- Add a devm callback to unregister the i2c device.
- Use devm_iio_device_register() to simplify removal code.

Various other minor improvements not called out explicitly.

* tag 'iio-for-6.13a-take2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (161 commits)
  iio: imu: bmi270: Remove duplicated include in bmi270_i2c.c
  iio: adc: ad7606: Drop spurious empty file.
  iio: light: rpr0521: Use generic iio_pollfunc_store_time()
  iio: light: vl6180: Add support for Continuous Mode
  iio: light: vl6180: Added Interrupt support for single shot access
  iio: light: vl6180: Add configurable inter-measurement period support
  MAINTAINERS: add entry for VEML6030 ambient light sensor driver
  iio: light: veml6030: add support for veml7700
  dt-bindings: iio: light: veml6030: add veml7700
  iio: light: veml6035: fix read_avail in no_irq case for veml6035
  iio: dac: adi-axi-dac: update register names
  iio: dac: adi-axi-dac: fix wrong register bitfield
  docs: iio: new docs for ad7625 driver
  iio: adc: ad7625: add driver
  dt-bindings: iio: adc: add AD762x/AD796x ADCs
  iio: Convert unsigned to unsigned int
  iio: pressure: bmp280: Fix uninitialized variable
  iio: Switch back to struct platform_driver::remove()
  iio: imu: bmi323: remove redundant register definition
  iio: frequency: adf4371: make use of dev_err_probe()
  ...

9 months agomisc: ti-st: st_kim: remove the driver
Bartosz Golaszewski [Wed, 16 Oct 2024 09:41:17 +0000 (11:41 +0200)]
misc: ti-st: st_kim: remove the driver

This driver has only ever been used by the omap4-panda board file. This
file has been gone for over 10 years. Let it go.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20241016094117.16654-1-brgl@bgdev.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Fix missing I2C dependency
Gerhard Engleder [Wed, 16 Oct 2024 18:27:51 +0000 (20:27 +0200)]
misc: keba: Fix missing I2C dependency

Kernel test robot reported a build error on csky:

drivers/misc/keba/cp500.c:287:(.text+0x1c0): undefined reference to `i2c_verify_client'

Add I2C dependency to fix build error.

Fixes: 794848300103 ("misc: keba: Add SPI controller device")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410130817.NXBCxx4q-lkp@intel.com/
Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241016182751.10457-1-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agoiio: imu: bmi270: Remove duplicated include in bmi270_i2c.c
Yang Li [Wed, 16 Oct 2024 00:39:19 +0000 (08:39 +0800)]
iio: imu: bmi270: Remove duplicated include in bmi270_i2c.c

The header files linux/module.h is included twice in bmi270_i2c.c,
so one inclusion of each can be removed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11363
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://patch.msgid.link/20241016003919.113306-1-yang.lee@linux.alibaba.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: adc: ad7606: Drop spurious empty file.
Jonathan Cameron [Thu, 17 Oct 2024 17:44:57 +0000 (18:44 +0100)]
iio: adc: ad7606: Drop spurious empty file.

Empty file unintentionally included in commit. Drop it.

Fixes: 94aab7a0f5c7 ("iio: adc: ad7606: rework available attributes for SW channels")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: rpr0521: Use generic iio_pollfunc_store_time()
Vasileios Amoiridis [Sun, 22 Sep 2024 16:20:40 +0000 (18:20 +0200)]
iio: light: rpr0521: Use generic iio_pollfunc_store_time()

The custom rpr0521_trigger_consumer_store_time() is registered as trigger
handler in the devm_iio_triggered_buffer_setup() function. This function
is called from the calling of the iio_trigger_poll() used in the
sysfs/hrt triggers and it is not used anywhere else in this driver.

The irq handler of the driver is the rpr0521_drdy_irq_handler() which
saves the timestamp and then wakes the irq thread. The irq thread is
the rpr0521_drdy_irq_thread() function which checks if the irq came
from the sensor and wakes up the trigger threaded handler through
iio_trigger_poll_nested() or returns IRQ_NONE in case the irq didn't
come from this sensor.

This means that in the current driver, you can't reach the
rpr0521_trigger_consumer_store_time() when the device's irq is
triggered. This means that the extra check of iio_trigger_using_own()
is redundant since it will always be false so the general
iio_pollfunc_store_time() can be used.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240922162041.525896-2-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: vl6180: Add support for Continuous Mode
Abhash Jha [Mon, 7 Oct 2024 15:22:23 +0000 (20:52 +0530)]
iio: light: vl6180: Add support for Continuous Mode

Added support for getting continuous readings from vl6180 using
triggered buffer approach. The continuous mode can be enabled by enabling
the buffer. Also added a trigger and appropriate checks to see that it is
used with this device.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20241007152223.59008-4-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: vl6180: Added Interrupt support for single shot access
Abhash Jha [Mon, 7 Oct 2024 15:22:22 +0000 (20:52 +0530)]
iio: light: vl6180: Added Interrupt support for single shot access

The interrupts are serviced in the `vl6180_measure` function when the
irq_handler signals that the reading is complete. We now can read
asynchronously if `client->irq` is set.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20241007152223.59008-3-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: vl6180: Add configurable inter-measurement period support
Abhash Jha [Mon, 7 Oct 2024 15:22:21 +0000 (20:52 +0530)]
iio: light: vl6180: Add configurable inter-measurement period support

Expose the IIO_CHAN_INFO_SAMP_FREQ attribute as a way to configure the
inter-measurement period for both the IIO_DISTANCE and IIO_LIGHT
channels. The inter-measurement period must be given in milihertz.

Signed-off-by: Abhash Jha <abhashkumarjha123@gmail.com>
Link: https://patch.msgid.link/20241007152223.59008-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoMAINTAINERS: add entry for VEML6030 ambient light sensor driver
Javier Carrasco [Tue, 8 Oct 2024 16:22:07 +0000 (18:22 +0200)]
MAINTAINERS: add entry for VEML6030 ambient light sensor driver

Add an entry in the MAINTAINERS file for this driver after contributing
to it.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241008-veml6030-maintainer-v1-1-701accdba961@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: add support for veml7700
Javier Carrasco [Mon, 7 Oct 2024 20:36:38 +0000 (22:36 +0200)]
iio: light: veml6030: add support for veml7700

The veml7700 contains the same sensor as the veml6030 in a different
package with no interrupt line and no pin to select the I2C address.

To handle the lack of the interrupt line and profit from the existing
support for the veml6030, add a specific iio_chan_spec with no
(num_)event_spec(s), and register the device's info from the
veml6030_info_no_irq struct.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241007-veml7700-v1-3-fb85dd839d63@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: iio: light: veml6030: add veml7700
Javier Carrasco [Mon, 7 Oct 2024 20:36:37 +0000 (22:36 +0200)]
dt-bindings: iio: light: veml6030: add veml7700

The veml7700 contains the same chip as the veml6030 in a different
package with no interrupt line and no pin to select the I2C address,
which makes it suitable to be supported by the same bindings.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241007-veml7700-v1-2-fb85dd839d63@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6035: fix read_avail in no_irq case for veml6035
Javier Carrasco [Mon, 7 Oct 2024 20:36:36 +0000 (22:36 +0200)]
iio: light: veml6035: fix read_avail in no_irq case for veml6035

The iio_info is identical for veml6030 and veml6035. Moreover,
veml6035_info_no_irq is missing the initialization of the read_avail
member, which is actually a bug if no irq is provided.

Instead of adding the missing initialization, remove the device-specific
iio_info and use the existing one for the veml6030.

Fixes: ccc26bd7d7d7 ("iio: light: veml6030: add support for veml6035")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241007-veml7700-v1-1-fb85dd839d63@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: dac: adi-axi-dac: update register names
Angelo Dureghello [Tue, 8 Oct 2024 15:43:34 +0000 (17:43 +0200)]
iio: dac: adi-axi-dac: update register names

Non functional, readability change.

Update register names so that register bitfields can be more easily
linked to the register name.

Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Link: https://patch.msgid.link/20241008-wip-bl-ad3552r-axi-v0-iio-testing-v5-2-3d410944a63d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: dac: adi-axi-dac: fix wrong register bitfield
Angelo Dureghello [Tue, 8 Oct 2024 15:43:33 +0000 (17:43 +0200)]
iio: dac: adi-axi-dac: fix wrong register bitfield

Fix ADI_DAC_R1_MODE of AXI_DAC_REG_CNTRL_2.

Both generic DAC and ad3552r DAC IPs docs are reporting
bit 5 for it.

Link: https://wiki.analog.com/resources/fpga/docs/axi_dac_ip
Fixes: 4e3949a192e4 ("iio: dac: add support for AXI DAC IP core")
Cc: stable@vger.kernel.org
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241008-wip-bl-ad3552r-axi-v0-iio-testing-v5-1-3d410944a63d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodocs: iio: new docs for ad7625 driver
Trevor Gamblin [Mon, 9 Sep 2024 14:30:49 +0000 (10:30 -0400)]
docs: iio: new docs for ad7625 driver

Add documentation for the AD7625/AD7626/AD7960/AD7961 ADCs.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Link: https://patch.msgid.link/20240909-ad7625_r1-v5-3-60a397768b25@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agorust: miscdevice: fix warning on c_uint to u32 cast
Alice Ryhl [Tue, 15 Oct 2024 14:13:22 +0000 (14:13 +0000)]
rust: miscdevice: fix warning on c_uint to u32 cast

When building miscdevice with clippy warnings, the following warning is
emitted:

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> /home/aliceryhl/rust-for-linux/rust/kernel/miscdevice.rs:220:28
    |
220 |     match T::ioctl(device, cmd as u32, arg as usize) {
    |                            ^^^^^^^^^^ help: try: `cmd`
    |
    = help: for further information visit
      https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `-W clippy::unnecessary-cast` implied by `-W clippy::all`
    = help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_cast)]`

Thus, fix it.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20241015-miscdevice-cint-cast-v1-1-fcf4b75700ac@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agoiio: adc: ad7625: add driver
Trevor Gamblin [Mon, 9 Sep 2024 14:30:48 +0000 (10:30 -0400)]
iio: adc: ad7625: add driver

Add a driver for the AD762x and AD796x family of ADCs. These are
pin-compatible devices using an LVDS interface for data transfer,
capable of sampling at rates of 6 (AD7625), 10 (AD7626), and 5
(AD7960/AD7961) MSPS, respectively. They also feature multiple voltage
reference options based on the configuration of the EN1/EN0 pins, which
can be set in the devicetree.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Link: https://patch.msgid.link/20240909-ad7625_r1-v5-2-60a397768b25@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agofirmware: memmap: Constify memmap_ktype
Kunwu Chan [Tue, 24 Sep 2024 03:05:32 +0000 (11:05 +0800)]
firmware: memmap: Constify memmap_ktype

This 'memmap_ktype' is not modified. It is only used in
firmware_map_add_entry().

Constifying this structure and moving it to a read-only section,
and this can increase over all security.

```
[Before]
   text    data     bss     dec     hex filename
   4345     596      12    4953    1359 drivers/firmware/memmap.o

[After]
   text    data     bss     dec     hex filename
   4393     548      12    4953    1359 drivers/firmware/memmap.o
```

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240924030533.34407-1-chentao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Add UART devices
Gerhard Engleder [Fri, 11 Oct 2024 19:12:57 +0000 (21:12 +0200)]
misc: keba: Add UART devices

Add support for the UART auxiliary devices. This enables access to up to
3 different UARTs, which are implemented in the FPGA.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-9-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Add battery device
Gerhard Engleder [Fri, 11 Oct 2024 19:12:56 +0000 (21:12 +0200)]
misc: keba: Add battery device

Add support for the battery auxiliary device. This enables monitoring of
the battery.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-8-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Add fan device
Gerhard Engleder [Fri, 11 Oct 2024 19:12:55 +0000 (21:12 +0200)]
misc: keba: Add fan device

Add support for the fan auxiliary device. This enables monitoring of the
fan.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-7-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Support EEPROM sections as separate devices
Gerhard Engleder [Fri, 11 Oct 2024 19:12:54 +0000 (21:12 +0200)]
misc: keba: Support EEPROM sections as separate devices

The main EEPROM of KEBA CP500 devices is divided into two sections. One
section for type label data like device name, order number, serial
number and so on. The second section is reserved for arbitrary data
stored by the user.

The two sections have a defined range. The first 3 kB for the type label
and the remaining 1 kB for user data. The type label is written during
production and can fill up the whole 3 kB. Thus, the range is fixed and
cannot be changed dynamically.

The two sections cannot be presented as NVMEM cells. A NVMEM cell is
always read and written at once, because the data presented to the user
can differ from the data stored in the physical NVMEM cell. Thus, NVMEM
cells would lead to reading 3 kB for every type label access, even if
only the device name is read. So performance would suffer. But it is
also an indication that NVMEM cells are designed for small data cells
within NVMEM devices.

Register separate NVMEM devices for every section. This enables safe
access to every section. Also different access rights are then possible.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-6-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Add LAN9252 driver
Gerhard Engleder [Fri, 11 Oct 2024 19:12:53 +0000 (21:12 +0200)]
misc: keba: Add LAN9252 driver

KEBA CP500 devices use the LAN9252 controller for EtherCAT
communication. For a stable Ethernet link the PHY registers of the
controller need to be configured correctly. This driver configures these
PHY registers as required.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-5-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Add SPI controller device
Gerhard Engleder [Fri, 11 Oct 2024 19:12:52 +0000 (21:12 +0200)]
misc: keba: Add SPI controller device

Add support for the SPI controller auxiliary device. This enables access
to the SPI flash of the FPGA and some other SPI devices.

The actual list of SPI devices is detected by reading some bits out of
the previously registered I2C EEPROM.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-4-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Use capital letters for I2C error message
Gerhard Engleder [Fri, 11 Oct 2024 19:12:51 +0000 (21:12 +0200)]
misc: keba: Use capital letters for I2C error message

Print "I2C" instead of "i2c" in error message as "I2C" is the official
name for the bus.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-3-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: keba: Use variable ret for return values
Gerhard Engleder [Fri, 11 Oct 2024 19:12:50 +0000 (21:12 +0200)]
misc: keba: Use variable ret for return values

One function of the cp500 driver uses the variable name retval for
return values but all others use the variable name ret. Use ret for
return values in all functions.

Signed-off-by: Gerhard Engleder <eg@keba.com>
Link: https://lore.kernel.org/r/20241011191257.19702-2-gerhard@engleder-embedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agouio: uio_pdrv_genirq: Make use of irq_get_trigger_type()
Vasileios Amoiridis [Thu, 12 Sep 2024 23:59:25 +0000 (01:59 +0200)]
uio: uio_pdrv_genirq: Make use of irq_get_trigger_type()

Convert the following case:

struct irq_data *irq_data = irq_get_irq_data(irq);

if (irq_data && irqd_get_trigger_type(irq_data) ... ) {
...
}

to the simpler:

if (irq_get_trigger_type(irq) ... ) {
...
}

by using the irq_get_trigger_type() function.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240912235925.54465-3-vassilisamir@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agouio: uio_dmem_genirq: Make use of irq_get_trigger_type()
Vasileios Amoiridis [Thu, 12 Sep 2024 23:59:24 +0000 (01:59 +0200)]
uio: uio_dmem_genirq: Make use of irq_get_trigger_type()

Convert the following case:

        struct irq_data *irq_data = irq_get_irq_data(irq);

        if (irq_data && irqd_get_trigger_type(irq_data) ... ) {
                ...
        }

to the simpler:

        if (irq_get_trigger_type(irq) ... ) {
                ...
        }

by using the irq_get_trigger_type() function.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240912235925.54465-2-vassilisamir@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agofirmware: mtk-adsp-ipc: Switch to using dev_err_probe()
AngeloGioacchino Del Regno [Thu, 19 Sep 2024 12:02:08 +0000 (14:02 +0200)]
firmware: mtk-adsp-ipc: Switch to using dev_err_probe()

There is an error path that checks whether the return value is
-EPROBE_DEFER to decide whether to print the error message: that
is exactly open-coding dev_err_probe(), so, switch to that.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240919120208.152987-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: add delivered_freeze to debugfs output
Carlos Llamas [Thu, 26 Sep 2024 23:36:19 +0000 (23:36 +0000)]
binder: add delivered_freeze to debugfs output

Add the pending proc->delivered_freeze work to the debugfs output. This
information was omitted in the original implementation of the freeze
notification and can be valuable for debugging issues.

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-9-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: fix memleak of proc->delivered_freeze
Carlos Llamas [Thu, 26 Sep 2024 23:36:18 +0000 (23:36 +0000)]
binder: fix memleak of proc->delivered_freeze

If a freeze notification is cleared with BC_CLEAR_FREEZE_NOTIFICATION
before calling binder_freeze_notification_done(), then it is detached
from its reference (e.g. ref->freeze) but the work remains queued in
proc->delivered_freeze. This leads to a memory leak when the process
exits as any pending entries in proc->delivered_freeze are not freed:

  unreferenced object 0xffff38e8cfa36180 (size 64):
    comm "binder-util", pid 655, jiffies 4294936641
    hex dump (first 32 bytes):
      b8 e9 9e c8 e8 38 ff ff b8 e9 9e c8 e8 38 ff ff  .....8.......8..
      0b 00 00 00 00 00 00 00 3c 1f 4b 00 00 00 00 00  ........<.K.....
    backtrace (crc 95983b32):
      [<000000000d0582cf>] kmemleak_alloc+0x34/0x40
      [<000000009c99a513>] __kmalloc_cache_noprof+0x208/0x280
      [<00000000313b1704>] binder_thread_write+0xdec/0x439c
      [<000000000cbd33bb>] binder_ioctl+0x1b68/0x22cc
      [<000000002bbedeeb>] __arm64_sys_ioctl+0x124/0x190
      [<00000000b439adee>] invoke_syscall+0x6c/0x254
      [<00000000173558fc>] el0_svc_common.constprop.0+0xac/0x230
      [<0000000084f72311>] do_el0_svc+0x40/0x58
      [<000000008b872457>] el0_svc+0x38/0x78
      [<00000000ee778653>] el0t_64_sync_handler+0x120/0x12c
      [<00000000a8ec61bf>] el0t_64_sync+0x190/0x194

This patch fixes the leak by ensuring that any pending entries in
proc->delivered_freeze are freed during binder_deferred_release().

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-8-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: allow freeze notification for dead nodes
Carlos Llamas [Thu, 26 Sep 2024 23:36:17 +0000 (23:36 +0000)]
binder: allow freeze notification for dead nodes

Alice points out that binder_request_freeze_notification() should not
return EINVAL when the relevant node is dead [1]. The node can die at
any point even if the user input is valid. Instead, allow the request
to be allocated but skip the initial notification for dead nodes. This
avoids propagating unnecessary errors back to userspace.

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/all/CAH5fLghapZJ4PbbkC8V5A6Zay-_sgTzwVpwqk6RWWUNKKyJC_Q@mail.gmail.com/
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-7-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: fix BINDER_WORK_CLEAR_FREEZE_NOTIFICATION debug logs
Carlos Llamas [Thu, 26 Sep 2024 23:36:16 +0000 (23:36 +0000)]
binder: fix BINDER_WORK_CLEAR_FREEZE_NOTIFICATION debug logs

proc 699
context binder-test
  thread 699: l 00 need_return 0 tr 0
  ref 25: desc 1 node 20 s 1 w 0 d 00000000c03e09a3
  unknown work: type 11

proc 640
context binder-test
  thread 640: l 00 need_return 0 tr 0
  ref 8: desc 1 node 3 s 1 w 0 d 000000002bb493e1
  has cleared freeze notification

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-6-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: fix BINDER_WORK_FROZEN_BINDER debug logs
Carlos Llamas [Thu, 26 Sep 2024 23:36:15 +0000 (23:36 +0000)]
binder: fix BINDER_WORK_FROZEN_BINDER debug logs

The BINDER_WORK_FROZEN_BINDER type is not handled in the binder_logs
entries and it shows up as "unknown work" when logged:

  proc 649
  context binder-test
    thread 649: l 00 need_return 0 tr 0
    ref 13: desc 1 node 8 s 1 w 0 d 0000000053c4c0c3
    unknown work: type 10

This patch add the freeze work type and is now logged as such:

  proc 637
  context binder-test
    thread 637: l 00 need_return 0 tr 0
    ref 8: desc 1 node 3 s 1 w 0 d 00000000dc39e9c6
    has frozen binder

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-5-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: fix freeze UAF in binder_release_work()
Carlos Llamas [Thu, 26 Sep 2024 23:36:14 +0000 (23:36 +0000)]
binder: fix freeze UAF in binder_release_work()

When a binder reference is cleaned up, any freeze work queued in the
associated process should also be removed. Otherwise, the reference is
freed while its ref->freeze.work is still queued in proc->work leading
to a use-after-free issue as shown by the following KASAN report:

  ==================================================================
  BUG: KASAN: slab-use-after-free in binder_release_work+0x398/0x3d0
  Read of size 8 at addr ffff31600ee91488 by task kworker/5:1/211

  CPU: 5 UID: 0 PID: 211 Comm: kworker/5:1 Not tainted 6.11.0-rc7-00382-gfc6c92196396 #22
  Hardware name: linux,dummy-virt (DT)
  Workqueue: events binder_deferred_func
  Call trace:
   binder_release_work+0x398/0x3d0
   binder_deferred_func+0xb60/0x109c
   process_one_work+0x51c/0xbd4
   worker_thread+0x608/0xee8

  Allocated by task 703:
   __kmalloc_cache_noprof+0x130/0x280
   binder_thread_write+0xdb4/0x42a0
   binder_ioctl+0x18f0/0x25ac
   __arm64_sys_ioctl+0x124/0x190
   invoke_syscall+0x6c/0x254

  Freed by task 211:
   kfree+0xc4/0x230
   binder_deferred_func+0xae8/0x109c
   process_one_work+0x51c/0xbd4
   worker_thread+0x608/0xee8
  ==================================================================

This commit fixes the issue by ensuring any queued freeze work is removed
when cleaning up a binder reference.

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Acked-by: Todd Kjos <tkjos@android.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-4-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: fix OOB in binder_add_freeze_work()
Carlos Llamas [Thu, 26 Sep 2024 23:36:13 +0000 (23:36 +0000)]
binder: fix OOB in binder_add_freeze_work()

In binder_add_freeze_work() we iterate over the proc->nodes with the
proc->inner_lock held. However, this lock is temporarily dropped to
acquire the node->lock first (lock nesting order). This can race with
binder_deferred_release() which removes the nodes from the proc->nodes
rbtree and adds them into binder_dead_nodes list. This leads to a broken
iteration in binder_add_freeze_work() as rb_next() will use data from
binder_dead_nodes, triggering an out-of-bounds access:

  ==================================================================
  BUG: KASAN: global-out-of-bounds in rb_next+0xfc/0x124
  Read of size 8 at addr ffffcb84285f7170 by task freeze/660

  CPU: 8 UID: 0 PID: 660 Comm: freeze Not tainted 6.11.0-07343-ga727812a8d45 #18
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   rb_next+0xfc/0x124
   binder_add_freeze_work+0x344/0x534
   binder_ioctl+0x1e70/0x25ac
   __arm64_sys_ioctl+0x124/0x190

  The buggy address belongs to the variable:
   binder_dead_nodes+0x10/0x40
  [...]
  ==================================================================

This is possible because proc->nodes (rbtree) and binder_dead_nodes
(list) share entries in binder_node through a union:

struct binder_node {
[...]
union {
struct rb_node rb_node;
struct hlist_node dead_node;
};

Fix the race by checking that the proc is still alive. If not, simply
break out of the iteration.

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-3-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinder: fix node UAF in binder_add_freeze_work()
Carlos Llamas [Thu, 26 Sep 2024 23:36:12 +0000 (23:36 +0000)]
binder: fix node UAF in binder_add_freeze_work()

In binder_add_freeze_work() we iterate over the proc->nodes with the
proc->inner_lock held. However, this lock is temporarily dropped in
order to acquire the node->lock first (lock nesting order). This can
race with binder_node_release() and trigger a use-after-free:

  ==================================================================
  BUG: KASAN: slab-use-after-free in _raw_spin_lock+0xe4/0x19c
  Write of size 4 at addr ffff53c04c29dd04 by task freeze/640

  CPU: 5 UID: 0 PID: 640 Comm: freeze Not tainted 6.11.0-07343-ga727812a8d45 #17
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   _raw_spin_lock+0xe4/0x19c
   binder_add_freeze_work+0x148/0x478
   binder_ioctl+0x1e70/0x25ac
   __arm64_sys_ioctl+0x124/0x190

  Allocated by task 637:
   __kmalloc_cache_noprof+0x12c/0x27c
   binder_new_node+0x50/0x700
   binder_transaction+0x35ac/0x6f74
   binder_thread_write+0xfb8/0x42a0
   binder_ioctl+0x18f0/0x25ac
   __arm64_sys_ioctl+0x124/0x190

  Freed by task 637:
   kfree+0xf0/0x330
   binder_thread_read+0x1e88/0x3a68
   binder_ioctl+0x16d8/0x25ac
   __arm64_sys_ioctl+0x124/0x190
  ==================================================================

Fix the race by taking a temporary reference on the node before
releasing the proc->inner lock. This ensures the node remains alive
while in use.

Fixes: d579b04a52a1 ("binder: frozen notification")
Cc: stable@vger.kernel.org
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20240926233632.821189-2-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agorpmb: Remove some useless locking
Christophe JAILLET [Wed, 9 Oct 2024 20:53:06 +0000 (22:53 +0200)]
rpmb: Remove some useless locking

There is no need for explicit locking when using the ida API, as stated in
the doc related to ida_alloc_range() / ida_free().

So remove rpmb_mutex.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/b1fcc6707ec2b6309d50060fa52ccc2c892afde2.1728507153.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agorpmb: Remove usage of the deprecated ida_simple_xx() API
Christophe JAILLET [Wed, 9 Oct 2024 20:53:05 +0000 (22:53 +0200)]
rpmb: Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/df8bfbe2a603c596566a4f967e37d10d208bbc3f.1728507153.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agobinderfs: binderfs_test: remove unused variable
Ba Jing [Tue, 3 Sep 2024 04:16:20 +0000 (12:16 +0800)]
binderfs: binderfs_test: remove unused variable

The variable "wret" is never referenced in the code, just remove it.

Signed-off-by: Ba Jing <bajing@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20240903041620.10812-1-bajing@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: apds990x: Fix missing pm_runtime_disable()
Jinjie Ruan [Mon, 23 Sep 2024 03:55:56 +0000 (11:55 +0800)]
misc: apds990x: Fix missing pm_runtime_disable()

The pm_runtime_disable() is missing in probe error path,
so add it to fix it.

Fixes: 92b1f84d46b2 ("drivers/misc: driver for APDS990X ALS and proximity sensors")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240923035556.3009105-1-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomisc: eeprom_93xx46: Changing 'unsigned' to 'unsigned int'
Daniel Hejduk [Sat, 5 Oct 2024 16:56:53 +0000 (18:56 +0200)]
misc: eeprom_93xx46: Changing 'unsigned' to 'unsigned int'

Fixes checkpatch warning: Prefer 'unsigned int' to bare use of 'unsigned'.

Signed-off-by: Daniel Hejduk <danielhejduk@disroot.org>
Link: https://lore.kernel.org/r/20241005165653.26160-1-danielhejduk@disroot.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agomei: bus: Reorganize kerneldoc parameter names
Julia Lawall [Mon, 30 Sep 2024 11:20:59 +0000 (13:20 +0200)]
mei: bus: Reorganize kerneldoc parameter names

Reorganize kerneldoc parameter names to match the parameter
order in the function header.

Problems identified using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20240930112121.95324-14-Julia.Lawall@inria.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agoMAINTAINERS: change mei driver maintainer
Tomas Winkler [Mon, 30 Sep 2024 09:06:04 +0000 (12:06 +0300)]
MAINTAINERS: change mei driver maintainer

Change maintainer of mei driver to Alexander Usyskin

Cc: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Alexander Usyskin <alexander.usyskin@intel.com>
Link: https://lore.kernel.org/r/20240930090604.1788402-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agodt-bindings: iio: adc: add AD762x/AD796x ADCs
Trevor Gamblin [Mon, 9 Sep 2024 14:30:47 +0000 (10:30 -0400)]
dt-bindings: iio: adc: add AD762x/AD796x ADCs

Add a binding specification for the Analog Devices Inc. AD7625,
AD7626, AD7960, and AD7961 ADCs.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Link: https://patch.msgid.link/20240909-ad7625_r1-v5-1-60a397768b25@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoMerge tag 'pwm/duty_offset-for-6.13-rc1' into togreg
Jonathan Cameron [Sat, 12 Oct 2024 12:38:09 +0000 (13:38 +0100)]
Merge tag 'pwm/duty_offset-for-6.13-rc1' into togreg

pwm: Support for duty_offset

Support a new abstraction for pwm configuration that allows to specify
the time between start of period and the raising edge of the signal
("duty offset").

This is used in a patch series by Trevor Gamblin for triggering an ADC
conversion and afterwards read out the result. See
https://lore.kernel.org/linux-iio/20240909-ad7625_r1-v5-0-60a397768b25@baylibre.com/
for more details.

9 months agoiio: Convert unsigned to unsigned int
Andy Shevchenko [Thu, 10 Oct 2024 18:15:35 +0000 (21:15 +0300)]
iio: Convert unsigned to unsigned int

Simple type conversion with no functional change implied.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241010181535.3083262-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: pressure: bmp280: Fix uninitialized variable
Yo-Jung (Leo) Lin [Fri, 11 Oct 2024 11:52:24 +0000 (19:52 +0800)]
iio: pressure: bmp280: Fix uninitialized variable

clang found that the "offset" in bmp580_trigger_handler doesn't get
initialized before access. Add proper initialization to this variable.

Signed-off-by: Yo-Jung Lin (Leo) <0xff07@gmail.com>
Link: https://patch.msgid.link/20241011115334.367736-1-0xff07@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoMerge tag 'v6.12-rc2' into test2
Jonathan Cameron [Sat, 12 Oct 2024 10:22:25 +0000 (11:22 +0100)]
Merge tag 'v6.12-rc2' into test2

Linux 6.12-rc2

Resolved movement of asm/unaligned.h to linux/unaligned.h

9 months agoiio: Switch back to struct platform_driver::remove()
Uwe Kleine-König [Wed, 9 Oct 2024 06:00:57 +0000 (08:00 +0200)]
iio: Switch back to struct platform_driver::remove()

After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/iio/ to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.

While touching these files, make indention of the struct initializer
consistent in several files.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20241009060056.502059-2-u.kleine-koenig@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: imu: bmi323: remove redundant register definition
Tarang Raval [Wed, 9 Oct 2024 11:17:51 +0000 (16:47 +0530)]
iio: imu: bmi323: remove redundant register definition

BMI323_STEP_SC1_REG was defined twice.

Redundant definition has been removed

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Link: https://patch.msgid.link/20241009111828.43371-1-tarang.raval@siliconsignals.io
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: frequency: adf4371: make use of dev_err_probe()
Nuno Sa [Wed, 9 Oct 2024 14:16:46 +0000 (16:16 +0200)]
iio: frequency: adf4371: make use of dev_err_probe()

Use dev_err_probe() to simplify probe() error handling. While at it, add
some error log in case we fail to get clkin.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-4-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: frequency: adf4371: drop clkin from struct adf4371_state
Nuno Sa [Wed, 9 Oct 2024 14:16:45 +0000 (16:16 +0200)]
iio: frequency: adf4371: drop clkin from struct adf4371_state

We already cache clkin rate during probe and then never use the clk
object again. Hence, no point in saving in our global state struct.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-3-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: frequency: adf4371: drop spi_set_drvdata()
Nuno Sa [Wed, 9 Oct 2024 14:16:44 +0000 (16:16 +0200)]
iio: frequency: adf4371: drop spi_set_drvdata()

spi_set_drvdata() is not needed as there's no spi_get_drvdata() call in
the code.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-2-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: frequency: adf4371: make use of spi_get_device_match_data()
Nuno Sa [Wed, 9 Oct 2024 14:16:43 +0000 (16:16 +0200)]
iio: frequency: adf4371: make use of spi_get_device_match_data()

To use spi_get_device_match_data(), add the chip_info structure to the
of_device_id table which is always a good thing to do.

While at it, added dedicated variables for each chip (instead of the
harder to maintain array) and added a new string variable for the part
name.

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-dev-adf4371-minor-improv-v1-1-97f4f22ed941@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: adc: ad7944: add namespace to T_QUIET_NS
David Lechner [Wed, 9 Oct 2024 21:26:21 +0000 (16:26 -0500)]
iio: adc: ad7944: add namespace to T_QUIET_NS

Add AD7944_ namespace to T_QUIET_NS. This is the preferred style. This
way the bad style won't be copied when we add more T_ macros.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241009-iio-adc-ad7944-add-namespace-to-t_quiet_ns-v1-1-a216357a065c@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: pressure: rohm-bm1390: Remove redundant if statement
Colin Ian King [Thu, 10 Oct 2024 17:08:35 +0000 (18:08 +0100)]
iio: pressure: rohm-bm1390: Remove redundant if statement

There is a check on non-zero ret that is redundant because the
same check is being performed in a previous if statement and
also before that. The check is not required, remove it.

Signed-off-by: Colin Ian King <colin.i.king@intel.com>
Link: https://patch.msgid.link/20241010170835.772764-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: imu: bmi270: Add spi driver for bmi270 imu
Alex Lanzano [Wed, 2 Oct 2024 03:36:22 +0000 (23:36 -0400)]
iio: imu: bmi270: Add spi driver for bmi270 imu

Implement SPI driver for the Bosch BMI270 6-axis IMU. Provide raw read
write access to acceleration and angle velocity measurements via the SPI
interface on the device.

Signed-off-by: Alex Lanzano <lanzano.alex@gmail.com>
Link: https://patch.msgid.link/20241002033628.681812-1-lanzano.alex@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agorust: miscdevice: add base miscdevice abstraction
Alice Ryhl [Tue, 1 Oct 2024 08:22:22 +0000 (08:22 +0000)]
rust: miscdevice: add base miscdevice abstraction

Provide a `MiscDevice` trait that lets you specify the file operations
that you wish to provide for your misc device. For now, only three file
operations are provided: open, close, ioctl.

These abstractions only support MISC_DYNAMIC_MINOR. This enforces that
new miscdevices should not hard-code a minor number.

When implementing ioctl, the Result type is used. This means that you
can choose to return either of:
* An integer of type isize.
* An errno using the kernel::error::Error type.
When returning an isize, the integer is returned verbatim. It's mainly
intended for returning positive integers to userspace. However, it is
technically possible to return errors via the isize return value too.

To avoid having a dependency on files, this patch does not provide the
file operations callbacks a pointer to the file. This means that they
cannot check file properties such as O_NONBLOCK (which Binder needs).
Support for that can be added as a follow-up.

To avoid having a dependency on vma, this patch does not provide any way
to implement mmap (which Binder needs). Support for that can be added as
a follow-up.

Rust Binder will use these abstractions to create the /dev/binder file
when binderfs is disabled.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/rust-for-linux/20240328195457.225001-1-wedsonaf@gmail.com/
Link: https://lore.kernel.org/r/20241001-b4-miscdevice-v2-2-330d760041fa@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agorust: types: add Opaque::try_ffi_init
Alice Ryhl [Tue, 1 Oct 2024 08:22:21 +0000 (08:22 +0000)]
rust: types: add Opaque::try_ffi_init

This will be used by the miscdevice abstractions, as the C function
`misc_register` is fallible.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
Link: https://lore.kernel.org/r/20241001-b4-miscdevice-v2-1-330d760041fa@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 months agoLinux 6.12-rc2
Linus Torvalds [Sun, 6 Oct 2024 22:32:27 +0000 (15:32 -0700)]
Linux 6.12-rc2

9 months agoMerge tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masah...
Linus Torvalds [Sun, 6 Oct 2024 18:34:55 +0000 (11:34 -0700)]
Merge tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Move non-boot built-in DTBs to the .rodata section

 - Fix Kconfig bugs

 - Fix maint scripts in the linux-image Debian package

 - Import some list macros to scripts/include/

* tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: deb-pkg: Remove blank first line from maint scripts
  kbuild: fix a typo dt_binding_schema -> dt_binding_schemas
  scripts: import more list macros
  kconfig: qconf: fix buffer overflow in debug links
  kconfig: qconf: move conf_read() before drawing tree pain
  kconfig: clear expr::val_is_valid when allocated
  kconfig: fix infinite loop in sym_calc_choice()
  kbuild: move non-boot built-in DTBs to .rodata section

9 months agoMerge tag 'platform-drivers-x86-v6.12-2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 6 Oct 2024 18:11:01 +0000 (11:11 -0700)]
Merge tag 'platform-drivers-x86-v6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

 - Intel PMC fix for suspend/resume issues on some Sky and Kaby Lake
   laptops

 - Intel Diamond Rapids hw-id additions

 - Documentation and MAINTAINERS fixes

 - Some other small fixes

* tag 'platform-drivers-x86-v6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: x86-android-tablets: Fix use after free on platform_device_register() errors
  platform/x86: wmi: Update WMI driver API documentation
  platform/x86: dell-ddv: Fix typo in documentation
  platform/x86: dell-sysman: add support for alienware products
  platform/x86/intel: power-domains: Add Diamond Rapids support
  platform/x86: ISST: Add Diamond Rapids to support list
  platform/x86:intel/pmc: Disable ACPI PM Timer disabling on Sky and Kaby Lake
  platform/x86: dell-laptop: Do not fail when encountering unsupported batteries
  MAINTAINERS: Update Intel In Field Scan(IFS) entry
  platform/x86: ISST: Fix the KASAN report slab-out-of-bounds bug

9 months agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Sun, 6 Oct 2024 17:53:28 +0000 (10:53 -0700)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "ARM64:

   - Fix pKVM error path on init, making sure we do not change critical
     system registers as we're about to fail

   - Make sure that the host's vector length is at capped by a value
     common to all CPUs

   - Fix kvm_has_feat*() handling of "negative" features, as the current
     code is pretty broken

   - Promote Joey to the status of official reviewer, while James steps
     down -- hopefully only temporarly

  x86:

   - Fix compilation with KVM_INTEL=KVM_AMD=n

   - Fix disabling KVM_X86_QUIRK_SLOT_ZAP_ALL when shadow MMU is in use

  Selftests:

   - Fix compilation on non-x86 architectures"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  x86/reboot: emergency callbacks are now registered by common KVM code
  KVM: x86: leave kvm.ko out of the build if no vendor module is requested
  KVM: x86/mmu: fix KVM_X86_QUIRK_SLOT_ZAP_ALL for shadow MMU
  KVM: arm64: Fix kvm_has_feat*() handling of negative features
  KVM: selftests: Fix build on architectures other than x86_64
  KVM: arm64: Another reviewer reshuffle
  KVM: arm64: Constrain the host to the maximum shared SVE VL with pKVM
  KVM: arm64: Fix __pkvm_init_vcpu cptr_el2 error path

9 months agoMerge tag 'powerpc-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
Linus Torvalds [Sun, 6 Oct 2024 17:43:00 +0000 (10:43 -0700)]
Merge tag 'powerpc-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fix from Michael Ellerman:

 - Allow r30 to be used in vDSO code generation of getrandom

Thanks to Jason A. Donenfeld

* tag 'powerpc-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/vdso: allow r30 in vDSO code generation of getrandom

9 months agokbuild: deb-pkg: Remove blank first line from maint scripts
Aaron Thompson [Fri, 4 Oct 2024 07:52:45 +0000 (07:52 +0000)]
kbuild: deb-pkg: Remove blank first line from maint scripts

The blank line causes execve() to fail:

  # strace ./postinst
  execve("./postinst", ...) = -1 ENOEXEC (Exec format error)
  strace: exec: Exec format error
  +++ exited with 1 +++

However running the scripts via shell does work (at least with bash)
because the shell attempts to execute the file as a shell script when
execve() fails.

Fixes: b611daae5efc ("kbuild: deb-pkg: split image and debug objects staging out into functions")
Signed-off-by: Aaron Thompson <dev@aaront.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
9 months agokbuild: fix a typo dt_binding_schema -> dt_binding_schemas
Xu Yang [Wed, 25 Sep 2024 05:32:30 +0000 (13:32 +0800)]
kbuild: fix a typo dt_binding_schema -> dt_binding_schemas

If we follow "make help" to "make dt_binding_schema", we will see
below error:

$ make dt_binding_schema
make[1]: *** No rule to make target 'dt_binding_schema'.  Stop.
make: *** [Makefile:224: __sub-make] Error 2

It should be a typo. So this will fix it.

Fixes: 604a57ba9781 ("dt-bindings: kbuild: Add separate target/dependency for processed-schema.json")
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
9 months agoscripts: import more list macros
Sami Tolvanen [Mon, 23 Sep 2024 18:18:47 +0000 (18:18 +0000)]
scripts: import more list macros

Import list_is_first, list_is_last, list_replace, and list_replace_init.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
9 months agoiio: light: veml6030: add support for veml6035
Javier Carrasco [Tue, 1 Oct 2024 20:21:22 +0000 (22:21 +0200)]
iio: light: veml6030: add support for veml6035

The veml6035 is an ALS that shares most of its functionality with the
veml6030, which allows for some code recycling.

Some chip-specific properties differ and dedicated functions to get and
set the sensor gain as well as its initialization are required.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-9-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: iio: light: veml6030: add veml6035
Javier Carrasco [Tue, 1 Oct 2024 20:21:21 +0000 (22:21 +0200)]
dt-bindings: iio: light: veml6030: add veml6035

The veml6035 is a similar ambient light sensor to the veml6030, and
from the bindings point of view, it shares the same properties. Its
only difference in that respect is a different I2C address.

Estend the existing bindings to support the veml6035 ALS.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-8-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: power off device in probe error paths
Javier Carrasco [Tue, 1 Oct 2024 20:21:20 +0000 (22:21 +0200)]
iio: light: veml6030: power off device in probe error paths

Move devm_add_action_or_reset() with a device shut down action to the
hardware initialization function to ensure that any error path after
powering on the device leads to a power off. Add struct device *dev
to the argument list to clarify the device the action is registered
against, and use it wherever &client->dev was used.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-7-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: drop processed info for white channel
Javier Carrasco [Tue, 1 Oct 2024 20:21:19 +0000 (22:21 +0200)]
iio: light: veml6030: drop processed info for white channel

The resolution of the WHITE channel is not provided by the manufacturer,
neither in the datasheet nor in the application note (even their
proprietary application only processes the ALS channel, giving raw
values for WHITE).

The current implementation assumes that both resolutions are identical,
which is extremely unlikely, especially for photodiodes with different
spectral responses.

Drop the processed information as it is meaningless.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-6-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: use read_avail() for available attributes
Javier Carrasco [Tue, 1 Oct 2024 20:21:18 +0000 (22:21 +0200)]
iio: light: veml6030: use read_avail() for available attributes

Drop custom attributes by using the standard read_avail() callback to
read scale and integration time. When at it, add the integration time
and scale attributes fro the WHITE channel, as they modify its value as
well. To avoid breaking the current ABI, these attributes must be kept
as separate for both channels even though they are shared under the
hood.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-5-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: add support for a regulator
Javier Carrasco [Tue, 1 Oct 2024 20:21:17 +0000 (22:21 +0200)]
iio: light: veml6030: add support for a regulator

Use the device managed function from the regulator API to get and enable
a regulator powering the device.

Use "vdd" as the ID to account for the provided name in the datasheet.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-4-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: iio: light: veml6030: add vdd-supply property
Javier Carrasco [Tue, 1 Oct 2024 20:21:16 +0000 (22:21 +0200)]
dt-bindings: iio: light: veml6030: add vdd-supply property

Add vdd-supply to account for the sensor's power source.

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-3-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: use dev_err_probe()
Javier Carrasco [Tue, 1 Oct 2024 20:21:15 +0000 (22:21 +0200)]
iio: light: veml6030: use dev_err_probe()

Use the more convenient dev_err_probe() to get rid of the dev_err() +
return sequence in the probe error paths.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-2-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: light: veml6030: add set up delay after any power on sequence
Javier Carrasco [Tue, 1 Oct 2024 20:21:14 +0000 (22:21 +0200)]
iio: light: veml6030: add set up delay after any power on sequence

The veml6030 requires a delay of 4 ms after activating the sensor. That
is done correctly during the hw initialization, but it's missing after
resuming.

Move the delay to the power on function to make sure that it is always
observerd. When at it, use fsleep() instead of usleep_range() as such a
narrow range is not required.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20241001-veml6035-v3-1-d789f6ff147c@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: pressure: bmp280: Use char instead of s32 for data buffer
Vasileios Amoiridis [Mon, 30 Sep 2024 20:23:53 +0000 (22:23 +0200)]
iio: pressure: bmp280: Use char instead of s32 for data buffer

As it was reported and discussed here [1], storing the sensor data in an
endian aware s32 buffer is not optimal. Advertising the timestamp as an
addition of 2 s32 variables which is also implied is again not the best
practice. For that reason, change the s32 sensor_data buffer to a u8
buffer and align it properly.

[1]: https://lore.kernel.org/linux-iio/73d13cc0-afb9-4306-b498-5d821728c3ba@stanley.mountain/

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240930202353.38203-3-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: pressure: bmp280: Use unsigned type for raw values
Vasileios Amoiridis [Mon, 30 Sep 2024 20:23:52 +0000 (22:23 +0200)]
iio: pressure: bmp280: Use unsigned type for raw values

The adc values coming directly from the sensor in the BM{E,P}{2,3}xx
sensors are unsigned values so treat them as such.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Link: https://patch.msgid.link/20240930202353.38203-2-vassilisamir@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: iio: dac: ad3552r: fix maximum spi speed
Angelo Dureghello [Thu, 3 Oct 2024 17:29:01 +0000 (19:29 +0200)]
dt-bindings: iio: dac: ad3552r: fix maximum spi speed

Fix maximum SPI clock speed, as per datasheet (Rev. B, page 6).

Fixes: b0a96c5f599e ("dt-bindings: iio: dac: Add adi,ad3552r.yaml")
Cc: stable@vger.kernel.org
Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241003-wip-bl-ad3552r-axi-v0-iio-testing-v4-4-ceb157487329@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoMAINTAINERS: iio: imu: add entry for InvenSense MPU-6050 driver
Jean-Baptiste Maneyrol [Thu, 3 Oct 2024 13:38:24 +0000 (15:38 +0200)]
MAINTAINERS: iio: imu: add entry for InvenSense MPU-6050 driver

Add entry for inv_mpu6050 iio driver supporting InvenSense MPU-6xxx
and ICM-206xxx devices.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20241003-invn-maintainers-email-update-v2-3-ca5a4928eb22@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: iio: imu: migrate InvenSense email to TDK group domain
Jean-Baptiste Maneyrol [Thu, 3 Oct 2024 13:38:23 +0000 (15:38 +0200)]
dt-bindings: iio: imu: migrate InvenSense email to TDK group domain

Migrate maintainer email to TDK domain.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20241003-invn-maintainers-email-update-v2-2-ca5a4928eb22@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoMAINTAINERS: iio: migrate invensense email address to tdk domain
Jean-Baptiste Maneyrol [Thu, 3 Oct 2024 13:38:22 +0000 (15:38 +0200)]
MAINTAINERS: iio: migrate invensense email address to tdk domain

InvenSense is part of TDK group. Update email address to use the
TDK domain.

Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20241003-invn-maintainers-email-update-v2-1-ca5a4928eb22@tdk.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoMAINTAINERS: add the GE HealthCare PMC ADC driver entry
Herve Codina [Thu, 3 Oct 2024 11:46:41 +0000 (13:46 +0200)]
MAINTAINERS: add the GE HealthCare PMC ADC driver entry

After contributing the driver, add myself as the maintainer for the
GE HealthCare PCM ADC IIO driver.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Link: https://patch.msgid.link/20241003114641.672086-5-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoiio: adc: Add support for the GE HealthCare PMC ADC
Herve Codina [Thu, 3 Oct 2024 11:46:40 +0000 (13:46 +0200)]
iio: adc: Add support for the GE HealthCare PMC ADC

The GE HealthCare PMC Analog to Digital Converter (ADC) is a 16-Channel
(voltage and current), 16-Bit ADC with an I2C Interface.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241003114641.672086-4-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: iio: adc: Add the GE HealthCare PMC ADC
Herve Codina [Thu, 3 Oct 2024 11:46:39 +0000 (13:46 +0200)]
dt-bindings: iio: adc: Add the GE HealthCare PMC ADC

The GE HealthCare PMC Analog to Digital Converter (ADC) is a 16-Channel
(voltage and current), 16-Bit ADC with an I2C Interface.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20241003114641.672086-3-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodt-bindings: vendor-prefixes: Add an entry for GE HealthCare
Herve Codina [Thu, 3 Oct 2024 11:46:38 +0000 (13:46 +0200)]
dt-bindings: vendor-prefixes: Add an entry for GE HealthCare

Add the "gehc" entry for GE HealthCare.
https://www.gehealthcare.com

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Ian Ray <ian.ray@gehealthcare.com>
Link: https://patch.msgid.link/20241003114641.672086-2-herve.codina@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agodocs: iio: fix grammatical error
Ivin Joel Abraham [Wed, 2 Oct 2024 10:03:41 +0000 (15:33 +0530)]
docs: iio: fix grammatical error

Clarify the instruction for disabling autocalibration by adding the word
"by"

Signed-off-by: Ivin Joel Abraham <ivinjabraham@gmail.com>
Link: https://patch.msgid.link/20241002100341.110435-1-ivinjabraham@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
9 months agoplatform/x86: x86-android-tablets: Fix use after free on platform_device_register...
Hans de Goede [Sat, 5 Oct 2024 13:05:45 +0000 (15:05 +0200)]
platform/x86: x86-android-tablets: Fix use after free on platform_device_register() errors

x86_android_tablet_remove() frees the pdevs[] array, so it should not
be used after calling x86_android_tablet_remove().

When platform_device_register() fails, store the pdevs[x] PTR_ERR() value
into the local ret variable before calling x86_android_tablet_remove()
to avoid using pdevs[] after it has been freed.

Fixes: 5eba0141206e ("platform/x86: x86-android-tablets: Add support for instantiating platform-devs")
Fixes: e2200d3f26da ("platform/x86: x86-android-tablets: Add gpio_keys support to x86_android_tablet_init()")
Cc: stable@vger.kernel.org
Reported-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
Closes: https://lore.kernel.org/platform-driver-x86/20240917120458.7300-1-a.burakov@rosalinux.ru/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241005130545.64136-1-hdegoede@redhat.com
9 months agoplatform/x86: wmi: Update WMI driver API documentation
Armin Wolf [Sat, 5 Oct 2024 21:38:24 +0000 (23:38 +0200)]
platform/x86: wmi: Update WMI driver API documentation

The WMI driver core now passes the WMI event data to legacy notify
handlers, so WMI devices sharing notification IDs are now being
handled properly.

Fixes: e04e2b760ddb ("platform/x86: wmi: Pass event data directly to legacy notify handlers")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241005213825.701887-1-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoplatform/x86: dell-ddv: Fix typo in documentation
Anaswara T Rajan [Sat, 5 Oct 2024 07:00:56 +0000 (12:30 +0530)]
platform/x86: dell-ddv: Fix typo in documentation

Fix typo in word 'diagnostics' in documentation.

Signed-off-by: Anaswara T Rajan <anaswaratrajan@gmail.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241005070056.16326-1-anaswaratrajan@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoplatform/x86: dell-sysman: add support for alienware products
Crag Wang [Fri, 4 Oct 2024 15:27:58 +0000 (23:27 +0800)]
platform/x86: dell-sysman: add support for alienware products

Alienware supports firmware-attributes and has its own OEM string.

Signed-off-by: Crag Wang <crag_wang@dell.com>
Link: https://lore.kernel.org/r/20241004152826.93992-1-crag_wang@dell.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoplatform/x86/intel: power-domains: Add Diamond Rapids support
Srinivas Pandruvada [Thu, 3 Oct 2024 21:55:54 +0000 (14:55 -0700)]
platform/x86/intel: power-domains: Add Diamond Rapids support

Add Diamond Rapids (INTEL_PANTHERCOVE_X) to tpmi_cpu_ids to support
domaid id mappings.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20241003215554.3013807-3-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoplatform/x86: ISST: Add Diamond Rapids to support list
Srinivas Pandruvada [Thu, 3 Oct 2024 21:55:53 +0000 (14:55 -0700)]
platform/x86: ISST: Add Diamond Rapids to support list

Add Diamond Rapids (INTEL_PANTHERCOVE_X) to SST support list by adding
to isst_cpu_ids.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20241003215554.3013807-2-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoplatform/x86:intel/pmc: Disable ACPI PM Timer disabling on Sky and Kaby Lake
Hans de Goede [Thu, 3 Oct 2024 20:26:13 +0000 (22:26 +0200)]
platform/x86:intel/pmc: Disable ACPI PM Timer disabling on Sky and Kaby Lake

There have been multiple reports that the ACPI PM Timer disabling is
causing Sky and Kaby Lake systems to hang on all suspend (s2idle, s3,
hibernate) methods.

Remove the acpi_pm_tmr_ctl_offset and acpi_pm_tmr_disable_bit settings from
spt_reg_map to disable the ACPI PM Timer disabling on Sky and Kaby Lake to
fix the hang on suspend.

Fixes: e86c8186d03a ("platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended")
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Closes: https://lore.kernel.org/linux-pm/18784f62-91ff-4d88-9621-6c88eb0af2b5@molgen.mpg.de/
Reported-by: Todd Brandt <todd.e.brandt@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219346
Cc: Marek Maslanka <mmaslanka@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Todd Brandt <todd.e.brandt@intel.com>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de> # Dell XPS 13 9360/0596KF
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20241003202614.17181-2-hdegoede@redhat.com
9 months agoplatform/x86: dell-laptop: Do not fail when encountering unsupported batteries
Armin Wolf [Tue, 1 Oct 2024 21:28:35 +0000 (23:28 +0200)]
platform/x86: dell-laptop: Do not fail when encountering unsupported batteries

If the battery hook encounters a unsupported battery, it will
return an error. This in turn will cause the battery driver to
automatically unregister the battery hook.

On machines with multiple batteries however, this will prevent
the battery hook from handling the primary battery, since it will
always get unregistered upon encountering one of the unsupported
batteries.

Fix this by simply ignoring unsupported batteries.

Reviewed-by: Pali Rohár <pali@kernel.org>
Fixes: ab58016c68cc ("platform/x86:dell-laptop: Add knobs to change battery charge settings")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241001212835.341788-4-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoMAINTAINERS: Update Intel In Field Scan(IFS) entry
Jithu Joseph [Tue, 1 Oct 2024 17:08:08 +0000 (10:08 -0700)]
MAINTAINERS: Update Intel In Field Scan(IFS) entry

Ashok is no longer with Intel and his e-mail address will start bouncing
soon.  Update his email address to the new one he provided to ensure
correct contact details in the MAINTAINERS file.

Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Link: https://lore.kernel.org/r/20241001170808.203970-1-jithu.joseph@intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9 months agoMerge tag 'kvmarm-fixes-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Paolo Bonzini [Sun, 6 Oct 2024 07:59:22 +0000 (03:59 -0400)]
Merge tag 'kvmarm-fixes-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD

KVM/arm64 fixes for 6.12, take #1

- Fix pKVM error path on init, making sure we do not change critical
  system registers as we're about to fail

- Make sure that the host's vector length is at capped by a value
  common to all CPUs

- Fix kvm_has_feat*() handling of "negative" features, as the current
  code is pretty broken

- Promote Joey to the status of official reviewer, while James steps
  down -- hopefully only temporarly

9 months agox86/reboot: emergency callbacks are now registered by common KVM code
Paolo Bonzini [Tue, 1 Oct 2024 14:34:58 +0000 (10:34 -0400)]
x86/reboot: emergency callbacks are now registered by common KVM code

Guard them with CONFIG_KVM_X86_COMMON rather than the two vendor modules.
In practice this has no functional change, because CONFIG_KVM_X86_COMMON
is set if and only if at least one vendor-specific module is being built.
However, it is cleaner to specify CONFIG_KVM_X86_COMMON for functions that
are used in kvm.ko.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixes: 590b09b1d88e ("KVM: x86: Register "emergency disable" callbacks when virt is enabled")
Fixes: 6d55a94222db ("x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>