Commit a0652eb2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull char / misc driver fixes from Greg KH:
 "Here are a small number of various driver fixes for 6.7-rc7 that
  normally come through the char-misc tree, and one debugfs fix as well.

  Included in here are:

   - iio and hid sensor driver fixes for a number of small things

   - interconnect driver fixes

   - brcm_nvmem driver fixes

   - debugfs fix for previous fix

   - guard() definition in device.h so that many subsystems can start
     using it for 6.8-rc1 (requested by Dan Williams to make future
     merges easier)

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'char-misc-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
  debugfs: initialize cancellations earlier
  Revert "iio: hid-sensor-als: Add light color temperature support"
  Revert "iio: hid-sensor-als: Add light chromaticity support"
  nvmem: brcm_nvram: store a copy of NVRAM content
  dt-bindings: nvmem: mxs-ocotp: Document fsl,ocotp
  driver core: Add a guard() definition for the device_lock()
  interconnect: qcom: icc-rpm: Fix peak rate calculation
  iio: adc: MCP3564: fix hardware identification logic
  iio: adc: MCP3564: fix calib_bias and calib_scale range checks
  iio: adc: meson: add separate config for axg SoC family
  iio: adc: imx93: add four channels for imx93 adc
  iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma()
  interconnect: qcom: sm8250: Enable sync_state
  iio: triggered-buffer: prevent possible freeing of wrong buffer
  iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw
  iio: imu: adis16475: use bit numbers in assign_bit()
  iio: imu: adis16475: add spi_device_id table
  iio: tmag5273: fix temperature offset
  interconnect: Treat xlate() returning NULL node as an error
  iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table
  ...
parents fa655abe 159f5bda
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -15,9 +15,11 @@ allOf:

properties:
  compatible:
    enum:
    items:
      - enum:
          - fsl,imx23-ocotp
          - fsl,imx28-ocotp
      - const: fsl,ocotp

  reg:
    maxItems: 1
@@ -35,7 +37,7 @@ unevaluatedProperties: false
examples:
  - |
    ocotp: efuse@8002c000 {
        compatible = "fsl,imx28-ocotp";
        compatible = "fsl,imx28-ocotp", "fsl,ocotp";
        #address-cells = <1>;
        #size-cells = <1>;
        reg = <0x8002c000 0x2000>;
+26 −11
Original line number Diff line number Diff line
@@ -393,17 +393,17 @@ static const unsigned int kx022a_odrs[] = {
 *	(range / 2^bits) * g = (range / 2^bits) * 9.80665 m/s^2
 *	=> KX022A uses 16 bit (HiRes mode - assume the low 8 bits are zeroed
 *	in low-power mode(?) )
 *	=> +/-2G  => 4 / 2^16 * 9,80665 * 10^6 (to scale to micro)
 *	=> +/-2G  - 598.550415
 *	   +/-4G  - 1197.10083
 *	   +/-8G  - 2394.20166
 *	   +/-16G - 4788.40332
 *	=> +/-2G  => 4 / 2^16 * 9,80665
 *	=> +/-2G  - 0.000598550415
 *	   +/-4G  - 0.00119710083
 *	   +/-8G  - 0.00239420166
 *	   +/-16G - 0.00478840332
 */
static const int kx022a_scale_table[][2] = {
	{ 598, 550415 },
	{ 1197, 100830 },
	{ 2394, 201660 },
	{ 4788, 403320 },
	{ 0, 598550 },
	{ 0, 1197101 },
	{ 0, 2394202 },
	{ 0, 4788403 },
};

static int kx022a_read_avail(struct iio_dev *indio_dev,
@@ -422,7 +422,7 @@ static int kx022a_read_avail(struct iio_dev *indio_dev,
		*vals = (const int *)kx022a_scale_table;
		*length = ARRAY_SIZE(kx022a_scale_table) *
			  ARRAY_SIZE(kx022a_scale_table[0]);
		*type = IIO_VAL_INT_PLUS_MICRO;
		*type = IIO_VAL_INT_PLUS_NANO;
		return IIO_AVAIL_LIST;
	default:
		return -EINVAL;
@@ -485,6 +485,20 @@ static int kx022a_turn_on_unlock(struct kx022a_data *data)
	return ret;
}

static int kx022a_write_raw_get_fmt(struct iio_dev *idev,
				    struct iio_chan_spec const *chan,
				    long mask)
{
	switch (mask) {
	case IIO_CHAN_INFO_SCALE:
		return IIO_VAL_INT_PLUS_NANO;
	case IIO_CHAN_INFO_SAMP_FREQ:
		return IIO_VAL_INT_PLUS_MICRO;
	default:
		return -EINVAL;
	}
}

static int kx022a_write_raw(struct iio_dev *idev,
			    struct iio_chan_spec const *chan,
			    int val, int val2, long mask)
@@ -629,7 +643,7 @@ static int kx022a_read_raw(struct iio_dev *idev,

		kx022a_reg2scale(regval, val, val2);

		return IIO_VAL_INT_PLUS_MICRO;
		return IIO_VAL_INT_PLUS_NANO;
	}

	return -EINVAL;
@@ -856,6 +870,7 @@ static int kx022a_fifo_flush(struct iio_dev *idev, unsigned int samples)
static const struct iio_info kx022a_info = {
	.read_raw = &kx022a_read_raw,
	.write_raw = &kx022a_write_raw,
	.write_raw_get_fmt = &kx022a_write_raw_get_fmt,
	.read_avail = &kx022a_read_avail,

	.validate_trigger	= iio_validate_own_trigger,
+4 −0
Original line number Diff line number Diff line
@@ -93,6 +93,10 @@ static const struct iio_chan_spec imx93_adc_iio_channels[] = {
	IMX93_ADC_CHAN(1),
	IMX93_ADC_CHAN(2),
	IMX93_ADC_CHAN(3),
	IMX93_ADC_CHAN(4),
	IMX93_ADC_CHAN(5),
	IMX93_ADC_CHAN(6),
	IMX93_ADC_CHAN(7),
};

static void imx93_adc_power_down(struct imx93_adc *adc)
+4 −4
Original line number Diff line number Diff line
@@ -918,7 +918,7 @@ static int mcp3564_write_raw(struct iio_dev *indio_dev,
		mutex_unlock(&adc->lock);
		return ret;
	case IIO_CHAN_INFO_CALIBBIAS:
		if (val < mcp3564_calib_bias[0] && val > mcp3564_calib_bias[2])
		if (val < mcp3564_calib_bias[0] || val > mcp3564_calib_bias[2])
			return -EINVAL;

		mutex_lock(&adc->lock);
@@ -928,7 +928,7 @@ static int mcp3564_write_raw(struct iio_dev *indio_dev,
		mutex_unlock(&adc->lock);
		return ret;
	case IIO_CHAN_INFO_CALIBSCALE:
		if (val < mcp3564_calib_scale[0] && val > mcp3564_calib_scale[2])
		if (val < mcp3564_calib_scale[0] || val > mcp3564_calib_scale[2])
			return -EINVAL;

		if (adc->calib_scale == val)
@@ -1122,7 +1122,7 @@ static int mcp3564_config(struct iio_dev *indio_dev)
	enum mcp3564_ids ids;
	int ret = 0;
	unsigned int tmp = 0x01;
	bool err = true;
	bool err = false;

	/*
	 * The address is set on a per-device basis by fuses in the factory,
@@ -1509,5 +1509,5 @@ static struct spi_driver mcp3564_driver = {
module_spi_driver(mcp3564_driver);

MODULE_AUTHOR("Marius Cristea <marius.cristea@microchip.com>");
MODULE_DESCRIPTION("Microchip MCP346x/MCP346xR and MCP356x/MCP346xR ADCs");
MODULE_DESCRIPTION("Microchip MCP346x/MCP346xR and MCP356x/MCP356xR ADCs");
MODULE_LICENSE("GPL v2");
+15 −1
Original line number Diff line number Diff line
@@ -1241,6 +1241,20 @@ static const struct meson_sar_adc_param meson_sar_adc_gxl_param = {
	.cmv_select = 1,
};

static const struct meson_sar_adc_param meson_sar_adc_axg_param = {
	.has_bl30_integration = true,
	.clock_rate = 1200000,
	.bandgap_reg = MESON_SAR_ADC_REG11,
	.regmap_config = &meson_sar_adc_regmap_config_gxbb,
	.resolution = 12,
	.disable_ring_counter = 1,
	.has_reg11 = true,
	.vref_volatge = 1,
	.has_vref_select = true,
	.vref_select = VREF_VDDA,
	.cmv_select = 1,
};

static const struct meson_sar_adc_param meson_sar_adc_g12a_param = {
	.has_bl30_integration = false,
	.clock_rate = 1200000,
@@ -1285,7 +1299,7 @@ static const struct meson_sar_adc_data meson_sar_adc_gxm_data = {
};

static const struct meson_sar_adc_data meson_sar_adc_axg_data = {
	.param = &meson_sar_adc_gxl_param,
	.param = &meson_sar_adc_axg_param,
	.name = "meson-axg-saradc",
};

Loading