Commit 6cf62f01 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull char / misc / IIO fixes from Greg KH:
 "Here are some much-delayed char/misc/iio driver fixes for 6.18-rc8.

  Fixes in here include:

   - lots of iio driver bugfixes for reported issues.

   - counter driver bugfix

   - slimbus driver bugfix

   - mei tiny bugfix

   - nvmem layout uevent bugfix

  All of these have been in linux-next for a while, but due to travel on
  my side, I haven't had a chance to get them to you"

* tag 'char-misc-6.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (23 commits)
  nvmem: layouts: fix nvmem_layout_bus_uevent
  iio: accel: bmc150: Fix irq assumption regression
  most: usb: fix double free on late probe failure
  slimbus: ngd: Fix reference count leak in qcom_slim_ngd_notify_slaves
  firmware: stratix10-svc: fix bug in saving controller data
  mei: fix error flow in probe
  iio: st_lsm6dsx: Fixed calibrated timestamp calculation
  iio: humditiy: hdc3020: fix units for thresholds and hysteresis
  iio: humditiy: hdc3020: fix units for temperature and humidity measurement
  iio: imu: st_lsm6dsx: fix array size for st_lsm6dsx_settings fields
  iio: accel: fix ADXL355 startup race condition
  iio: adc: ad7124: fix temperature channel
  iio:common:ssp_sensors: Fix an error handling path ssp_probe()
  iio: adc: ad7280a: fix ad7280_store_balance_timer()
  iio: buffer-dmaengine: enable .get_dma_dev()
  iio: buffer-dma: support getting the DMA channel
  iio: buffer: support getting dma channel from the buffer
  iio: pressure: bmp280: correct meas_time_us calculation
  iio: adc: stm32-dfsdm: fix st,adc-alt-channel property handling
  iio: adc: ad7380: fix SPI offload trigger rate
  ...
parents dabf127d 03bc4831
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ static void mchp_tc_irq_remove(void *ptr)
static int mchp_tc_irq_enable(struct counter_device *const counter, int irq)
{
	struct mchp_tc_data *const priv = counter_priv(counter);
	int ret = devm_request_irq(counter->parent, irq, mchp_tc_isr, 0,
	int ret = devm_request_irq(counter->parent, irq, mchp_tc_isr, IRQF_SHARED,
				   dev_name(counter->parent), counter);

	if (ret < 0)
+4 −3
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ struct stratix10_svc_data {
 * @complete_status: state for completion
 * @svc_fifo_lock: protect access to service message data queue
 * @invoke_fn: function to issue secure monitor call or hypervisor call
 * @svc: manages the list of client svc drivers
 *
 * This struct is used to create communication channels for service clients, to
 * handle secure monitor or hypervisor call.
@@ -150,6 +151,7 @@ struct stratix10_svc_controller {
	struct completion complete_status;
	spinlock_t svc_fifo_lock;
	svc_invoke_fn *invoke_fn;
	struct stratix10_svc *svc;
};

/**
@@ -1206,6 +1208,7 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
		ret = -ENOMEM;
		goto err_free_kfifo;
	}
	controller->svc = svc;

	svc->stratix10_svc_rsu = platform_device_alloc(STRATIX10_RSU, 0);
	if (!svc->stratix10_svc_rsu) {
@@ -1237,8 +1240,6 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
	if (ret)
		goto err_unregister_fcs_dev;

	dev_set_drvdata(dev, svc);

	pr_info("Intel Service Layer Driver Initialized\n");

	return 0;
@@ -1256,8 +1257,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)

static void stratix10_svc_drv_remove(struct platform_device *pdev)
{
	struct stratix10_svc *svc = dev_get_drvdata(&pdev->dev);
	struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev);
	struct stratix10_svc *svc = ctrl->svc;

	of_platform_depopulate(ctrl->dev);

+39 −5
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@
#define  ADXL355_POWER_CTL_DRDY_MSK	BIT(2)
#define ADXL355_SELF_TEST_REG		0x2E
#define ADXL355_RESET_REG		0x2F
#define ADXL355_BASE_ADDR_SHADOW_REG	0x50
#define ADXL355_SHADOW_REG_COUNT	5

#define ADXL355_DEVID_AD_VAL		0xAD
#define ADXL355_DEVID_MST_VAL		0x1D
@@ -294,7 +296,12 @@ static void adxl355_fill_3db_frequency_table(struct adxl355_data *data)
static int adxl355_setup(struct adxl355_data *data)
{
	unsigned int regval;
	int retries = 5; /* the number is chosen based on empirical reasons */
	int ret;
	u8 *shadow_regs __free(kfree) = kzalloc(ADXL355_SHADOW_REG_COUNT, GFP_KERNEL);

	if (!shadow_regs)
		return -ENOMEM;

	ret = regmap_read(data->regmap, ADXL355_DEVID_AD_REG, &regval);
	if (ret)
@@ -321,13 +328,40 @@ static int adxl355_setup(struct adxl355_data *data)
	if (regval != ADXL355_PARTID_VAL)
		dev_warn(data->dev, "Invalid DEV ID 0x%02x\n", regval);

	/* Read shadow registers to be compared after reset */
	ret = regmap_bulk_read(data->regmap,
			       ADXL355_BASE_ADDR_SHADOW_REG,
			       shadow_regs, ADXL355_SHADOW_REG_COUNT);
	if (ret)
		return ret;

	do {
		if (--retries == 0) {
			dev_err(data->dev, "Shadow registers mismatch\n");
			return -EIO;
		}

		/*
		 * Perform a software reset to make sure the device is in a consistent
		 * state after start-up.
		 */
	ret = regmap_write(data->regmap, ADXL355_RESET_REG, ADXL355_RESET_CODE);
		ret = regmap_write(data->regmap, ADXL355_RESET_REG,
				   ADXL355_RESET_CODE);
		if (ret)
			return ret;

		/* Wait at least 5ms after software reset */
		usleep_range(5000, 10000);

		/* Read shadow registers for comparison */
		ret = regmap_bulk_read(data->regmap,
				       ADXL355_BASE_ADDR_SHADOW_REG,
				       data->buffer.buf,
				       ADXL355_SHADOW_REG_COUNT);
		if (ret)
			return ret;
	} while (memcmp(shadow_regs, data->buffer.buf,
			ADXL355_SHADOW_REG_COUNT));

	ret = regmap_update_bits(data->regmap, ADXL355_POWER_CTL_REG,
				 ADXL355_POWER_CTL_DRDY_MSK,
+5 −0
Original line number Diff line number Diff line
@@ -523,6 +523,10 @@ static int bmc150_accel_set_interrupt(struct bmc150_accel_data *data, int i,
	const struct bmc150_accel_interrupt_info *info = intr->info;
	int ret;

	/* We do not always have an IRQ */
	if (data->irq <= 0)
		return 0;

	if (state) {
		if (atomic_inc_return(&intr->users) > 1)
			return 0;
@@ -1696,6 +1700,7 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
	}

	if (irq > 0) {
		data->irq = irq;
		ret = devm_request_threaded_irq(dev, irq,
						bmc150_accel_irq_handler,
						bmc150_accel_irq_thread_handler,
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ enum bmc150_accel_trigger_id {

struct bmc150_accel_data {
	struct regmap *regmap;
	int irq;
	struct regulator_bulk_data regulators[2];
	struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS];
	struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS];
Loading