]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'char-misc-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 17 Feb 2024 16:52:38 +0000 (08:52 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 17 Feb 2024 16:52:38 +0000 (08:52 -0800)
Pull char / miscdriver fixes from Greg KH:
 "Here is a small set of char/misc and IIO driver fixes for 6.8-rc5.

  Included in here are:

   - lots of iio driver fixes for reported issues

   - nvmem device naming fixup for reported problem

   - interconnect driver fixes for reported issues

  All of these have been in linux-next for a while with no reported the
  issues (the nvmem patch was included in a different branch in
  linux-next before sent to me for inclusion here)"

* tag 'char-misc-6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
  nvmem: include bit index in cell sysfs file name
  iio: adc: ad4130: only set GPIO_CTRL if pin is unused
  iio: adc: ad4130: zero-initialize clock init data
  interconnect: qcom: x1e80100: Add missing ACV enable_mask
  interconnect: qcom: sm8650: Use correct ACV enable_mask
  iio: accel: bma400: Fix a compilation problem
  iio: commom: st_sensors: ensure proper DMA alignment
  iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP
  iio: move LIGHT_UVA and LIGHT_UVB to the end of iio_modifier
  staging: iio: ad5933: fix type mismatch regression
  iio: humidity: hdc3020: fix temperature offset
  iio: adc: ad7091r8: Fix error code in ad7091r8_gpio_setup()
  iio: adc: ad_sigma_delta: ensure proper DMA alignment
  iio: imu: adis: ensure proper DMA alignment
  iio: humidity: hdc3020: Add Makefile, Kconfig and MAINTAINERS entry
  iio: imu: bno055: serdev requires REGMAP
  iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC
  iio: pressure: bmp280: Add missing bmp085 to SPI id table
  iio: core: fix memleak in iio_device_register_sysfs
  interconnect: qcom: sm8550: Enable sync_state
  ...

23 files changed:
Documentation/ABI/testing/sysfs-nvmem-cells
MAINTAINERS
drivers/iio/accel/Kconfig
drivers/iio/adc/ad4130.c
drivers/iio/adc/ad7091r8.c
drivers/iio/humidity/Kconfig
drivers/iio/humidity/Makefile
drivers/iio/humidity/hdc3020.c
drivers/iio/imu/bno055/Kconfig
drivers/iio/industrialio-core.c
drivers/iio/light/hid-sensor-als.c
drivers/iio/magnetometer/rm3100-core.c
drivers/iio/pressure/bmp280-spi.c
drivers/interconnect/qcom/sc8180x.c
drivers/interconnect/qcom/sm8550.c
drivers/interconnect/qcom/sm8650.c
drivers/interconnect/qcom/x1e80100.c
drivers/nvmem/core.c
drivers/staging/iio/impedance-analyzer/ad5933.c
include/linux/iio/adc/ad_sigma_delta.h
include/linux/iio/common/st_sensors.h
include/linux/iio/imu/adis.h
include/uapi/linux/iio/types.h

index 7af70adf3690e3b0b3a3c148a087ecb3f788d54a..c7c9444f92a880ff3f9971fc52f71a0e2756d5f1 100644 (file)
@@ -4,18 +4,18 @@ KernelVersion:        6.5
 Contact:       Miquel Raynal <miquel.raynal@bootlin.com>
 Description:
                The "cells" folder contains one file per cell exposed by the
-               NVMEM device. The name of the file is: <name>@<where>, with
-               <name> being the cell name and <where> its location in the NVMEM
-               device, in hexadecimal (without the '0x' prefix, to mimic device
-               tree node names). The length of the file is the size of the cell
-               (when known). The content of the file is the binary content of
-               the cell (may sometimes be ASCII, likely without trailing
-               character).
+               NVMEM device. The name of the file is: "<name>@<byte>,<bit>",
+               with <name> being the cell name and <where> its location in
+               the NVMEM device, in hexadecimal bytes and bits (without the
+               '0x' prefix, to mimic device tree node names). The length of
+               the file is the size of the cell (when known). The content of
+               the file is the binary content of the cell (may sometimes be
+               ASCII, likely without trailing character).
                Note: This file is only present if CONFIG_NVMEM_SYSFS
                is enabled.
 
                Example::
 
-                 hexdump -C /sys/bus/nvmem/devices/1-00563/cells/product-name@d
+                 hexdump -C /sys/bus/nvmem/devices/1-00563/cells/product-name@d,0
                  00000000  54 4e 34 38 4d 2d 50 2d  44 4e         |TN48M-P-DN|
                  0000000a
index d87384c64a13ae1cbcc19ab6c9e50f70f6c9f69a..3dbb4db6e8586260b16f8ce226e5ea43158756a6 100644 (file)
@@ -22010,6 +22010,14 @@ F:     Documentation/devicetree/bindings/media/i2c/ti,ds90*
 F:     drivers/media/i2c/ds90*
 F:     include/media/i2c/ds90*
 
+TI HDC302X HUMIDITY DRIVER
+M:     Javier Carrasco <javier.carrasco.cruz@gmail.com>
+M:     Li peiyu <579lpy@gmail.com>
+L:     linux-iio@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
+F:     drivers/iio/humidity/hdc3020.c
+
 TI ICSSG ETHERNET DRIVER (ICSSG)
 R:     MD Danish Anwar <danishanwar@ti.com>
 R:     Roger Quadros <rogerq@kernel.org>
index 91adcac875a4130d75d887b80464b76dd1f422a0..c9d7afe489e832b4a9598ffe9266084dbebd9fd6 100644 (file)
@@ -219,10 +219,12 @@ config BMA400
 
 config BMA400_I2C
        tristate
+       select REGMAP_I2C
        depends on BMA400
 
 config BMA400_SPI
        tristate
+       select REGMAP_SPI
        depends on BMA400
 
 config BMC150_ACCEL
index feb86fe6c422df4ad3085b1c4ffea1651ad4cfd1..62490424b6aed44698c376560550af353073b72b 100644 (file)
@@ -1821,7 +1821,7 @@ static int ad4130_setup_int_clk(struct ad4130_state *st)
 {
        struct device *dev = &st->spi->dev;
        struct device_node *of_node = dev_of_node(dev);
-       struct clk_init_data init;
+       struct clk_init_data init = {};
        const char *clk_name;
        int ret;
 
@@ -1891,10 +1891,14 @@ static int ad4130_setup(struct iio_dev *indio_dev)
                return ret;
 
        /*
-        * Configure all GPIOs for output. If configured, the interrupt function
-        * of P2 takes priority over the GPIO out function.
+        * Configure unused GPIOs for output. If configured, the interrupt
+        * function of P2 takes priority over the GPIO out function.
         */
-       val =  AD4130_IO_CONTROL_GPIO_CTRL_MASK;
+       val = 0;
+       for (i = 0; i < AD4130_MAX_GPIOS; i++)
+               if (st->pins_fn[i + AD4130_AIN2_P1] == AD4130_PIN_FN_NONE)
+                       val |= FIELD_PREP(AD4130_IO_CONTROL_GPIO_CTRL_MASK, BIT(i));
+
        val |= FIELD_PREP(AD4130_IO_CONTROL_INT_PIN_SEL_MASK, st->int_pin_sel);
 
        ret = regmap_write(st->regmap, AD4130_IO_CONTROL_REG, val);
index 57700f12480382b82299c5822ae2fb42a8d7f391..70056430505752682f5fd2c3b2e56ef1db48c7b7 100644 (file)
@@ -195,7 +195,7 @@ static int ad7091r8_gpio_setup(struct ad7091r_state *st)
        st->reset_gpio = devm_gpiod_get_optional(st->dev, "reset",
                                                 GPIOD_OUT_HIGH);
        if (IS_ERR(st->reset_gpio))
-               return dev_err_probe(st->dev, PTR_ERR(st->convst_gpio),
+               return dev_err_probe(st->dev, PTR_ERR(st->reset_gpio),
                                     "Error on requesting reset GPIO\n");
 
        if (st->reset_gpio) {
index 2de5494e7c22585aa52f016dc18e30c4f8107f37..b15b7a3b66d5a4d84bf3b48d46d88b29ec7c00d7 100644 (file)
@@ -48,6 +48,18 @@ config HDC2010
          To compile this driver as a module, choose M here: the module
          will be called hdc2010.
 
+config HDC3020
+       tristate "TI HDC3020 relative humidity and temperature sensor"
+       depends on I2C
+       select CRC8
+       help
+         Say yes here to build support for the Texas Instruments
+         HDC3020, HDC3021 and HDC3022 relative humidity and temperature
+         sensors.
+
+         To compile this driver as a module, choose M here: the module
+         will be called hdc3020.
+
 config HID_SENSOR_HUMIDITY
        tristate "HID Environmental humidity sensor"
        depends on HID_SENSOR_HUB
index f19ff3de97c56743f0ac51e2768e11c7a2816846..5fbeef299f61bfff07c6dd1f2215cf147d015b4f 100644 (file)
@@ -7,6 +7,7 @@ obj-$(CONFIG_AM2315) += am2315.o
 obj-$(CONFIG_DHT11) += dht11.o
 obj-$(CONFIG_HDC100X) += hdc100x.o
 obj-$(CONFIG_HDC2010) += hdc2010.o
+obj-$(CONFIG_HDC3020) += hdc3020.o
 obj-$(CONFIG_HID_SENSOR_HUMIDITY) += hid-sensor-humidity.o
 
 hts221-y := hts221_core.o \
index 4e3311170725bc55fa3a5dd1c2a90dccb6c3aa19..ed70415512f687b6333078f9416b9a0fd6edbfdb 100644 (file)
@@ -322,7 +322,7 @@ static int hdc3020_read_raw(struct iio_dev *indio_dev,
                if (chan->type != IIO_TEMP)
                        return -EINVAL;
 
-               *val = 16852;
+               *val = -16852;
                return IIO_VAL_INT;
 
        default:
index 83e53acfbe88011f4306f19438b6f31d4cad5b22..c7f5866a177d90edef7c30bfe54ada71cc17870c 100644 (file)
@@ -8,6 +8,7 @@ config BOSCH_BNO055
 config BOSCH_BNO055_SERIAL
        tristate "Bosch BNO055 attached via UART"
        depends on SERIAL_DEV_BUS
+       select REGMAP
        select BOSCH_BNO055
        help
          Enable this to support Bosch BNO055 IMUs attached via UART.
index 9a85752124ddc43b10ecb12ed2c48f605395b170..173dc00762a152e414feac8f1d8d626e01d4bde8 100644 (file)
@@ -1584,10 +1584,13 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev)
        ret = iio_device_register_sysfs_group(indio_dev,
                                              &iio_dev_opaque->chan_attr_group);
        if (ret)
-               goto error_clear_attrs;
+               goto error_free_chan_attrs;
 
        return 0;
 
+error_free_chan_attrs:
+       kfree(iio_dev_opaque->chan_attr_group.attrs);
+       iio_dev_opaque->chan_attr_group.attrs = NULL;
 error_clear_attrs:
        iio_free_chan_devattr_list(&iio_dev_opaque->channel_attr_list);
 
index 5cd27f04b45e6d911ae53e7574a916455149c2a5..b6c4bef2a7bb22bbe42463ffc7d72e934e0a2591 100644 (file)
@@ -226,6 +226,7 @@ static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
        case HID_USAGE_SENSOR_TIME_TIMESTAMP:
                als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes,
                                                                    *(s64 *)raw_data);
+               ret = 0;
                break;
        default:
                break;
index 69938204456f8bb0c1c4777d93ee7d0b8f2421dd..42b70cd42b39359ddd542e273163cab829128ab4 100644 (file)
@@ -530,6 +530,7 @@ int rm3100_common_probe(struct device *dev, struct regmap *regmap, int irq)
        struct rm3100_data *data;
        unsigned int tmp;
        int ret;
+       int samp_rate_index;
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
        if (!indio_dev)
@@ -586,9 +587,14 @@ int rm3100_common_probe(struct device *dev, struct regmap *regmap, int irq)
        ret = regmap_read(regmap, RM3100_REG_TMRC, &tmp);
        if (ret < 0)
                return ret;
+
+       samp_rate_index = tmp - RM3100_TMRC_OFFSET;
+       if (samp_rate_index < 0 || samp_rate_index >=  RM3100_SAMP_NUM) {
+               dev_err(dev, "The value read from RM3100_REG_TMRC is invalid!\n");
+               return -EINVAL;
+       }
        /* Initializing max wait time, which is double conversion time. */
-       data->conversion_time = rm3100_samp_rates[tmp - RM3100_TMRC_OFFSET][2]
-                               * 2;
+       data->conversion_time = rm3100_samp_rates[samp_rate_index][2] * 2;
 
        /* Cycle count values may not be what we want. */
        if ((tmp - RM3100_TMRC_OFFSET) == 0)
index 433d6fac83c4cd95f698e1063a78c36dde79b374..e8a5fed07e88835a019924a0b60bdb16233a95a3 100644 (file)
@@ -87,6 +87,7 @@ static const struct of_device_id bmp280_of_spi_match[] = {
 MODULE_DEVICE_TABLE(of, bmp280_of_spi_match);
 
 static const struct spi_device_id bmp280_spi_id[] = {
+       { "bmp085", (kernel_ulong_t)&bmp180_chip_info },
        { "bmp180", (kernel_ulong_t)&bmp180_chip_info },
        { "bmp181", (kernel_ulong_t)&bmp180_chip_info },
        { "bmp280", (kernel_ulong_t)&bmp280_chip_info },
index 20331e119beb694945b196df9fb2c7efff60feda..03d626776ba17a3ff18c91c1e685a0230e8fcbbb 100644 (file)
@@ -1372,6 +1372,7 @@ static struct qcom_icc_bcm bcm_mm0 = {
 
 static struct qcom_icc_bcm bcm_co0 = {
        .name = "CO0",
+       .keepalive = true,
        .num_nodes = 1,
        .nodes = { &slv_qns_cdsp_mem_noc }
 };
index 629faa4c9aaee280e7514695dcd2c96e9125d1dd..fc22cecf650fc4eedaf3970a6a8f025f7e9d849e 100644 (file)
@@ -2223,6 +2223,7 @@ static struct platform_driver qnoc_driver = {
        .driver = {
                .name = "qnoc-sm8550",
                .of_match_table = qnoc_of_match,
+               .sync_state = icc_sync_state,
        },
 };
 
index b83de54577b6874553624390e0e0145fd966a38a..b962e6c233ef78ed3ed44cf0b0777bb62fbd50a6 100644 (file)
@@ -1160,7 +1160,7 @@ static struct qcom_icc_node qns_gemnoc_sf = {
 
 static struct qcom_icc_bcm bcm_acv = {
        .name = "ACV",
-       .enable_mask = BIT(3),
+       .enable_mask = BIT(0),
        .num_nodes = 1,
        .nodes = { &ebi },
 };
index d19501d913b39c696a337ff4f5d3a54aa07915c4..cbaf4f9c41be656212b50dce683273911e1e1cd6 100644 (file)
@@ -1586,6 +1586,7 @@ static struct qcom_icc_node qns_pcie_south_gem_noc_pcie = {
 
 static struct qcom_icc_bcm bcm_acv = {
        .name = "ACV",
+       .enable_mask = BIT(3),
        .num_nodes = 1,
        .nodes = { &ebi },
 };
index 980123fb4dde05d0e5cd4e0cfe5645b24a8d55dc..eb357ac2e54a2a827ad07b9a073d3e76415a000f 100644 (file)
@@ -460,8 +460,9 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)
        list_for_each_entry(entry, &nvmem->cells, node) {
                sysfs_bin_attr_init(&attrs[i]);
                attrs[i].attr.name = devm_kasprintf(&nvmem->dev, GFP_KERNEL,
-                                                   "%s@%x", entry->name,
-                                                   entry->offset);
+                                                   "%s@%x,%x", entry->name,
+                                                   entry->offset,
+                                                   entry->bit_offset);
                attrs[i].attr.mode = 0444;
                attrs[i].size = entry->bytes;
                attrs[i].read = &nvmem_cell_attr_read;
index e748a5d04e970598c4bee3b52c19a57fcbbd1c12..9149d41fe65b7ed48785f80bc712902278eccec3 100644 (file)
@@ -608,7 +608,7 @@ static void ad5933_work(struct work_struct *work)
                struct ad5933_state, work.work);
        struct iio_dev *indio_dev = i2c_get_clientdata(st->client);
        __be16 buf[2];
-       int val[2];
+       u16 val[2];
        unsigned char status;
        int ret;
 
index 7852f6c9a714c6fb7dc84321c4b416717b6d4666..719cf9cc6e1ac4db6abbd1171b1590716dc50dc9 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef __AD_SIGMA_DELTA_H__
 #define __AD_SIGMA_DELTA_H__
 
+#include <linux/iio/iio.h>
+
 enum ad_sigma_delta_mode {
        AD_SD_MODE_CONTINUOUS = 0,
        AD_SD_MODE_SINGLE = 1,
@@ -99,7 +101,7 @@ struct ad_sigma_delta {
         * 'rx_buf' is up to 32 bits per sample + 64 bit timestamp,
         * rounded to 16 bytes to take into account padding.
         */
-       uint8_t                         tx_buf[4] ____cacheline_aligned;
+       uint8_t                         tx_buf[4] __aligned(IIO_DMA_MINALIGN);
        uint8_t                         rx_buf[16] __aligned(8);
 };
 
index 607c3a89a6471df963e6fc4ed09df84b53c0db0f..f9ae5cdd884f5be041246b5aebbf6467980319dc 100644 (file)
@@ -258,9 +258,9 @@ struct st_sensor_data {
        bool hw_irq_trigger;
        s64 hw_timestamp;
 
-       char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] ____cacheline_aligned;
-
        struct mutex odr_lock;
+
+       char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] __aligned(IIO_DMA_MINALIGN);
 };
 
 #ifdef CONFIG_IIO_BUFFER
index dc9ea299e0885cd55018f21b80a35155d0ca1d63..8898966bc0f08c152a8156b85151b223f76e9ffe 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <linux/spi/spi.h>
 #include <linux/interrupt.h>
+#include <linux/iio/iio.h>
 #include <linux/iio/types.h>
 
 #define ADIS_WRITE_REG(reg) ((0x80 | (reg)))
@@ -131,7 +132,7 @@ struct adis {
        unsigned long           irq_flag;
        void                    *buffer;
 
-       u8                      tx[10] ____cacheline_aligned;
+       u8                      tx[10] __aligned(IIO_DMA_MINALIGN);
        u8                      rx[4];
 };
 
index 5060963707b1ed44d9b640454e9b0656a505d761..f2e0b2d50e6b5ffadd52ced37e8a1e36999c9d97 100644 (file)
@@ -91,8 +91,6 @@ enum iio_modifier {
        IIO_MOD_CO2,
        IIO_MOD_VOC,
        IIO_MOD_LIGHT_UV,
-       IIO_MOD_LIGHT_UVA,
-       IIO_MOD_LIGHT_UVB,
        IIO_MOD_LIGHT_DUV,
        IIO_MOD_PM1,
        IIO_MOD_PM2P5,
@@ -107,6 +105,8 @@ enum iio_modifier {
        IIO_MOD_PITCH,
        IIO_MOD_YAW,
        IIO_MOD_ROLL,
+       IIO_MOD_LIGHT_UVA,
+       IIO_MOD_LIGHT_UVB,
 };
 
 enum iio_event_type {