diff for duplicates of <20181125102757.2c34371c@archlinux> diff --git a/a/1.txt b/N1/1.txt index eed657b..8fef998 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -2,12 +2,12 @@ On Fri, 23 Nov 2018 15:24:09 +0100 Philippe Schenker <dev@pschenker.ch> wrote: > From: Stefan Agner <stefan@agner.ch> -> +>=20 > This adds an ADC driver for the STMPE device using the industrial > input/output interface. The driver supports raw reading of values. > The driver depends on the MFD STMPE driver. If the touchscreen > block is enabled too, only four of the 8 ADC channels are available. -> +>=20 > Signed-off-by: Stefan Agner <stefan@agner.ch> > Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> > Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> @@ -31,11 +31,11 @@ Thanks, Jonathan > --- -> +>=20 > Changes in v3: > - Undo ADC-settings related code-deletions in stmpe-ts.c that the code is > backwards-compatible to older devicetrees. -> +>=20 > Changes in v2: > - Code formatting > - Move code to setup ADC to MFD device, as it is used by both drivers @@ -43,10 +43,11 @@ Jonathan > - Removed unused includes > - Defined the macro STMPE_START_ONE_TEMP_CONV with other macros. > - Added new macro that defines the channel of the temperature sensor. -> Took new name for STMPE_MAX_ADC->STMPE_ADC_LAST_NR and used it throughout +> Took new name for STMPE_MAX_ADC->STMPE_ADC_LAST_NR and used it through= +out > the code for better readability. > - Added mutex_unlock where missing. -> +>=20 > drivers/iio/adc/Kconfig | 7 + > drivers/iio/adc/Makefile | 1 + > drivers/iio/adc/stmpe-adc.c | 326 +++++++++++++++++++++++++++ @@ -56,7 +57,7 @@ Jonathan > include/linux/mfd/stmpe.h | 9 + > 7 files changed, 437 insertions(+), 26 deletions(-) > create mode 100644 drivers/iio/adc/stmpe-adc.c -> +>=20 > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig > index a52fea8749a9..224f2067494d 100644 > --- a/drivers/iio/adc/Kconfig @@ -64,7 +65,7 @@ Jonathan > @@ -734,6 +734,13 @@ config STM32_DFSDM_ADC > This driver can also be built as a module. If so, the module > will be called stm32-dfsdm-adc. -> +> =20 > +config STMPE_ADC > + tristate "STMicroelectronics STMPE ADC driver" > + depends on OF && MFD_STMPE @@ -79,14 +80,14 @@ Jonathan > index a6e6a0b659e2..cba889c30bf9 100644 > --- a/drivers/iio/adc/Makefile > +++ b/drivers/iio/adc/Makefile -> @@ -69,6 +69,7 @@ obj-$(CONFIG_STM32_ADC_CORE) += stm32-adc-core.o -> obj-$(CONFIG_STM32_ADC) += stm32-adc.o -> obj-$(CONFIG_STM32_DFSDM_CORE) += stm32-dfsdm-core.o -> obj-$(CONFIG_STM32_DFSDM_ADC) += stm32-dfsdm-adc.o -> +obj-$(CONFIG_STMPE_ADC) += stmpe-adc.o -> obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o -> obj-$(CONFIG_TI_ADC0832) += ti-adc0832.o -> obj-$(CONFIG_TI_ADC084S021) += ti-adc084s021.o +> @@ -69,6 +69,7 @@ obj-$(CONFIG_STM32_ADC_CORE) +=3D stm32-adc-core.o +> obj-$(CONFIG_STM32_ADC) +=3D stm32-adc.o +> obj-$(CONFIG_STM32_DFSDM_CORE) +=3D stm32-dfsdm-core.o +> obj-$(CONFIG_STM32_DFSDM_ADC) +=3D stm32-dfsdm-adc.o +> +obj-$(CONFIG_STMPE_ADC) +=3D stmpe-adc.o +> obj-$(CONFIG_TI_ADC081C) +=3D ti-adc081c.o +> obj-$(CONFIG_TI_ADC0832) +=3D ti-adc0832.o +> obj-$(CONFIG_TI_ADC084S021) +=3D ti-adc084s021.o > diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c > new file mode 100644 > index 000000000000..bea3f3c27bb5 @@ -157,7 +158,7 @@ Jonathan > + int *val2, > + long mask) > +{ -> + struct stmpe_adc *info = iio_priv(indio_dev); +> + struct stmpe_adc *info =3D iio_priv(indio_dev); > + long ret; > + > + switch (mask) { @@ -176,7 +177,7 @@ trying to sanity check the documentation for a lock I expected to find in the private data structure that wasn't there!. > + -> + info->channel = (u8)chan->channel; +> + info->channel =3D (u8)chan->channel; > + > + switch (chan->type) { > + case IIO_VOLTAGE: @@ -203,11 +204,11 @@ helps! > + stmpe_reg_write(info->stmpe, STMPE_REG_ADC_CAPT, > + STMPE_ADC_CH(info->channel)); > + -> + *val = info->value; +> + *val =3D info->value; > + break; > + > + case IIO_TEMP: -> + if (info->channel != STMPE_TEMP_CHANNEL) { +> + if (info->channel !=3D STMPE_TEMP_CHANNEL) { > + mutex_unlock(&indio_dev->mlock); > + return -EINVAL; > + } @@ -220,12 +221,12 @@ helps! > + return -EINVAL; > + } > + -> + ret = wait_for_completion_interruptible_timeout +> + ret =3D wait_for_completion_interruptible_timeout > + (&info->completion, STMPE_ADC_TIMEOUT); > + -> + if (ret <= 0) { +> + if (ret <=3D 0) { > + mutex_unlock(&indio_dev->mlock); -> + if (ret == 0) +> + if (ret =3D=3D 0) > + return -ETIMEDOUT; > + else > + return ret; @@ -233,15 +234,15 @@ helps! > + > + switch (chan->type) { > + case IIO_VOLTAGE: -> + *val = info->value; +> + *val =3D info->value; > + break; > + > + case IIO_TEMP: > + /* -> + * absolute temp = +V3.3 * value /7.51 [K] -> + * scale to [milli °C] +> + * absolute temp =3D +V3.3 * value /7.51 [K] +> + * scale to [milli =C2=B0C] > + */ -> + *val = ((449960l * info->value) / 1024l) - 273150; +> + *val =3D ((449960l * info->value) / 1024l) - 273150; > + break; > + default: > + break; @@ -251,8 +252,8 @@ helps! > + return IIO_VAL_INT; > + > + case IIO_CHAN_INFO_SCALE: -> + *val = 3300; -> + *val2 = info->stmpe->mod_12b ? 12 : 10; +> + *val =3D 3300; +> + *val2 =3D info->stmpe->mod_12b ? 12 : 10; > + return IIO_VAL_FRACTIONAL_LOG2; > + > + default: @@ -264,16 +265,16 @@ helps! > + > +static irqreturn_t stmpe_adc_isr(int irq, void *dev_id) > +{ -> + struct stmpe_adc *info = (struct stmpe_adc *)dev_id; +> + struct stmpe_adc *info =3D (struct stmpe_adc *)dev_id; > + u8 data[2]; > + > + if (info->channel > STMPE_TEMP_CHANNEL) > + return IRQ_NONE; > + -> + if (info->channel <= STMPE_ADC_LAST_NR) { +> + if (info->channel <=3D STMPE_ADC_LAST_NR) { > + int int_sta; > + -> + int_sta = stmpe_reg_read(info->stmpe, STMPE_REG_ADC_INT_STA); +> + int_sta =3D stmpe_reg_read(info->stmpe, STMPE_REG_ADC_INT_STA); > + > + /* Is the interrupt relevant */ > + if (!(int_sta & STMPE_ADC_CH(info->channel))) @@ -284,12 +285,12 @@ helps! > + STMPE_REG_ADC_DATA_CH(info->channel), 2, data); > + > + stmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_STA, int_sta); -> + } else if (info->channel == STMPE_TEMP_CHANNEL) { +> + } else if (info->channel =3D=3D STMPE_TEMP_CHANNEL) { > + /* Read value */ > + stmpe_block_read(info->stmpe, STMPE_REG_TEMP_DATA, 2, data); > + } > + -> + info->value = ((u32)data[0] << 8) + data[1]; +> + info->value =3D ((u32)data[0] << 8) + data[1]; This is an endian conversion of aligned data. Can we use an appropriate endian to cpu function to do it as cleaner and quite possibly a noop. @@ -299,30 +300,30 @@ endian to cpu function to do it as cleaner and quite possibly a noop. > + return IRQ_HANDLED; > +} > + -> +static const struct iio_info stmpe_adc_iio_info = { -> + .read_raw = &stmpe_read_raw, +> +static const struct iio_info stmpe_adc_iio_info =3D { +> + .read_raw =3D &stmpe_read_raw, > +}; > + > +static void stmpe_adc_voltage_chan(struct iio_chan_spec *ics, int chan) > +{ -> + ics->type = IIO_VOLTAGE; -> + ics->info_mask_separate = BIT(IIO_CHAN_INFO_RAW); -> + ics->info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE); -> + ics->indexed = 1; -> + ics->channel = chan; +> + ics->type =3D IIO_VOLTAGE; +> + ics->info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW); +> + ics->info_mask_shared_by_type =3D BIT(IIO_CHAN_INFO_SCALE); +> + ics->indexed =3D 1; +> + ics->channel =3D chan; > +} > + > +static void stmpe_adc_temp_chan(struct iio_chan_spec *ics, int chan) > +{ -> + ics->type = IIO_TEMP; -> + ics->info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED); -> + ics->indexed = 1; -> + ics->channel = chan; +> + ics->type =3D IIO_TEMP; +> + ics->info_mask_separate =3D BIT(IIO_CHAN_INFO_PROCESSED); +> + ics->indexed =3D 1; +> + ics->channel =3D chan; > +} > + > +static int stmpe_adc_init_hw(struct stmpe_adc *adc) > +{ -> + struct stmpe *stmpe = adc->stmpe; +> + struct stmpe *stmpe =3D adc->stmpe; > + > + /* use temp irq for each conversion completion */ > + stmpe_reg_write(stmpe, STMPE_REG_TEMP_TH, 0); @@ -333,57 +334,58 @@ endian to cpu function to do it as cleaner and quite possibly a noop. > + > +static int stmpe_adc_probe(struct platform_device *pdev) > +{ -> + struct iio_dev *indio_dev = NULL; -> + struct stmpe_adc *info = NULL; +> + struct iio_dev *indio_dev =3D NULL; +> + struct stmpe_adc *info =3D NULL; > + struct device_node *np; -> + u32 norequest_mask = 0; +> + u32 norequest_mask =3D 0; > + int irq_temp, irq_adc; -> + int num_chan = 0; -> + int i = 0; +> + int num_chan =3D 0; +> + int i =3D 0; > + int ret; > + -> + irq_adc = platform_get_irq_byname(pdev, "STMPE_ADC"); +> + irq_adc =3D platform_get_irq_byname(pdev, "STMPE_ADC"); > + if (irq_adc < 0) > + return irq_adc; > + -> + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct stmpe_adc)); +> + indio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(struct stmpe_adc= +)); > + if (!indio_dev) { > + dev_err(&pdev->dev, "failed allocating iio device\n"); > + return -ENOMEM; > + } > + -> + info = iio_priv(indio_dev); +> + info =3D iio_priv(indio_dev); > + > + init_completion(&info->completion); -> + ret = devm_request_threaded_irq(&pdev->dev, irq_adc, NULL, +> + ret =3D devm_request_threaded_irq(&pdev->dev, irq_adc, NULL, > + stmpe_adc_isr, IRQF_ONESHOT, > + "stmpe-adc", info); > + if (ret < 0) { -> + dev_err(&pdev->dev, "failed requesting irq, irq = %d\n", +> + dev_err(&pdev->dev, "failed requesting irq, irq =3D %d\n", > + irq_adc); > + return ret; > + } > + -> + irq_temp = platform_get_irq_byname(pdev, "STMPE_TEMP_SENS"); -> + if (irq_temp >= 0) { -> + ret = devm_request_threaded_irq(&pdev->dev, irq_temp, NULL, +> + irq_temp =3D platform_get_irq_byname(pdev, "STMPE_TEMP_SENS"); +> + if (irq_temp >=3D 0) { +> + ret =3D devm_request_threaded_irq(&pdev->dev, irq_temp, NULL, > + stmpe_adc_isr, IRQF_ONESHOT, > + "stmpe-adc", info); > + if (ret < 0) > + dev_warn(&pdev->dev, "failed requesting irq for" -> + " temp sensor, irq = %d\n", irq_temp); +> + " temp sensor, irq =3D %d\n", irq_temp); > + } > + > + platform_set_drvdata(pdev, indio_dev); > + -> + indio_dev->name = dev_name(&pdev->dev); -> + indio_dev->dev.parent = &pdev->dev; -> + indio_dev->info = &stmpe_adc_iio_info; -> + indio_dev->modes = INDIO_DIRECT_MODE; +> + indio_dev->name =3D dev_name(&pdev->dev); +> + indio_dev->dev.parent =3D &pdev->dev; +> + indio_dev->info =3D &stmpe_adc_iio_info; +> + indio_dev->modes =3D INDIO_DIRECT_MODE; > + -> + info->stmpe = dev_get_drvdata(pdev->dev.parent); +> + info->stmpe =3D dev_get_drvdata(pdev->dev.parent); > + -> + np = pdev->dev.of_node; +> + np =3D pdev->dev.of_node; > + > + if (!np) > + dev_err(&pdev->dev, "no device tree node found\n"); @@ -397,10 +399,10 @@ endian to cpu function to do it as cleaner and quite possibly a noop. > + } > + stmpe_adc_temp_chan(&info->stmpe_adc_iio_channels[num_chan], i); > + num_chan++; -> + indio_dev->channels = info->stmpe_adc_iio_channels; -> + indio_dev->num_channels = num_chan; +> + indio_dev->channels =3D info->stmpe_adc_iio_channels; +> + indio_dev->num_channels =3D num_chan; > + -> + ret = stmpe_adc_init_hw(info); +> + ret =3D stmpe_adc_init_hw(info); > + if (ret) > + return ret; > + @@ -409,8 +411,8 @@ endian to cpu function to do it as cleaner and quite possibly a noop. > + > +static int stmpe_adc_remove(struct platform_device *pdev) > +{ -> + struct iio_dev *indio_dev = platform_get_drvdata(pdev); -> + struct stmpe_adc *info = iio_priv(indio_dev); +> + struct iio_dev *indio_dev =3D platform_get_drvdata(pdev); +> + struct stmpe_adc *info =3D iio_priv(indio_dev); > + > + iio_device_unregister(indio_dev); > + stmpe_disable(info->stmpe, STMPE_BLOCK_ADC); @@ -430,8 +432,8 @@ the ADC or moving the enable in here as necessary. > + > +static int __maybe_unused stmpe_adc_resume(struct device *dev) > +{ -> + struct iio_dev *indio_dev = dev_get_drvdata(dev); -> + struct stmpe_adc *info = iio_priv(indio_dev); +> + struct iio_dev *indio_dev =3D dev_get_drvdata(dev); +> + struct stmpe_adc *info =3D iio_priv(indio_dev); > + > + stmpe_adc_init_hw(info); > + @@ -440,12 +442,12 @@ the ADC or moving the enable in here as necessary. > + > +static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume); > + -> +static struct platform_driver stmpe_adc_driver = { -> + .probe = stmpe_adc_probe, -> + .remove = stmpe_adc_remove, -> + .driver = { -> + .name = "stmpe-adc", -> + .pm = &stmpe_adc_pm_ops, +> +static struct platform_driver stmpe_adc_driver =3D { +> + .probe =3D stmpe_adc_probe, +> + .remove =3D stmpe_adc_remove, +> + .driver =3D { +> + .name =3D "stmpe-adc", +> + .pm =3D &stmpe_adc_pm_ops, > + }, > +}; > + @@ -455,7 +457,8 @@ the ADC or moving the enable in here as necessary. > +MODULE_DESCRIPTION("STMPEXXX ADC driver"); > +MODULE_LICENSE("GPL v2"); > +MODULE_ALIAS("platform:stmpe-adc"); -> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c +> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchsc= +reen/stmpe-ts.c > index c5d9006588a2..81aa313d6e5a 100644 > --- a/drivers/input/touchscreen/stmpe-ts.c > +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -495,71 +498,73 @@ the ADC or moving the enable in here as necessary. > u8 ave_ctrl; > u8 touch_det_delay; > u8 settling; -> @@ -176,7 +161,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data) +> @@ -176,7 +161,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *da= +ta) > input_report_key(ts->idev, BTN_TOUCH, 1); > input_sync(ts->idev); -> +> =20 > - /* flush the FIFO after we have read out our values. */ > + /* flush the FIFO after we have read out our values. */ > __stmpe_reset_fifo(ts->stmpe); -> +> =20 > /* reenable the tsc */ > @@ -202,20 +187,21 @@ static int stmpe_init_hw(struct stmpe_touch *ts) > return ret; > } -> -> - adc_ctrl1 = STMPE_SAMPLE_TIME(ts->sample_time) | +> =20 +> - adc_ctrl1 =3D STMPE_SAMPLE_TIME(ts->sample_time) | > - STMPE_MOD_12B(ts->mod_12b) | STMPE_REF_SEL(ts->ref_sel); -> + adc_ctrl1 = STMPE_SAMPLE_TIME(stmpe->sample_time) | +> + adc_ctrl1 =3D STMPE_SAMPLE_TIME(stmpe->sample_time) | > + STMPE_MOD_12B(stmpe->mod_12b) | > + STMPE_REF_SEL(stmpe->ref_sel); Could we split this refactor out 'ahead' of the ADC patch? -> adc_ctrl1_mask = STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) | +> adc_ctrl1_mask =3D STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) | > STMPE_REF_SEL(0xff); -> -> - ret = stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL1, -> + ret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1, +> =20 +> - ret =3D stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL1, +> + ret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1, > adc_ctrl1_mask, adc_ctrl1); > if (ret) { > dev_err(dev, "Could not setup ADC\n"); > return ret; > } -> -> - ret = stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL2, +> =20 +> - ret =3D stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL2, > - STMPE_ADC_FREQ(0xff), STMPE_ADC_FREQ(ts->adc_freq)); -> + ret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2, +> + ret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2, > + STMPE_ADC_FREQ(0xff), STMPE_ADC_FREQ(stmpe->adc_freq)); > if (ret) { > dev_err(dev, "Could not setup ADC\n"); > return ret; -> @@ -295,13 +281,13 @@ static void stmpe_ts_get_platform_info(struct platform_device *pdev, -> +> @@ -295,13 +281,13 @@ static void stmpe_ts_get_platform_info(struct platf= +orm_device *pdev, +> =20 > if (np) { > if (!of_property_read_u32(np, "st,sample-time", &val)) -> - ts->sample_time = val; -> + ts->stmpe->sample_time = val; +> - ts->sample_time =3D val; +> + ts->stmpe->sample_time =3D val; > if (!of_property_read_u32(np, "st,mod-12b", &val)) -> - ts->mod_12b = val; -> + ts->stmpe->mod_12b = val; +> - ts->mod_12b =3D val; +> + ts->stmpe->mod_12b =3D val; > if (!of_property_read_u32(np, "st,ref-sel", &val)) -> - ts->ref_sel = val; -> + ts->stmpe->ref_sel = val; +> - ts->ref_sel =3D val; +> + ts->stmpe->ref_sel =3D val; > if (!of_property_read_u32(np, "st,adc-freq", &val)) -> - ts->adc_freq = val; -> + ts->stmpe->adc_freq = val; +> - ts->adc_freq =3D val; +> + ts->stmpe->adc_freq =3D val; > if (!of_property_read_u32(np, "st,ave-ctrl", &val)) -> ts->ave_ctrl = val; +> ts->ave_ctrl =3D val; > if (!of_property_read_u32(np, "st,touch-det-delay", &val)) > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index 8c5dfdce4326..bba159e8eaa4 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -1204,7 +1204,7 @@ config MFD_STMPE -> +> =20 > Currently supported devices are: -> +> =20 > - STMPE811: GPIO, Touchscreen > + STMPE811: GPIO, Touchscreen, ADC > STMPE1601: GPIO, Keypad @@ -570,64 +575,66 @@ Could we split this refactor out 'ahead' of the ADC patch? > Keypad: stmpe-keypad > Touchscreen: stmpe-ts > + ADC: stmpe-adc -> +> =20 > menu "STMicroelectronics STMPE Interface Drivers" > depends on MFD_STMPE > diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c > index 566caca4efd8..35390d1c2e64 100644 > --- a/drivers/mfd/stmpe.c > +++ b/drivers/mfd/stmpe.c -> @@ -463,6 +463,28 @@ static const struct mfd_cell stmpe_ts_cell = { -> .num_resources = ARRAY_SIZE(stmpe_ts_resources), +> @@ -463,6 +463,28 @@ static const struct mfd_cell stmpe_ts_cell =3D { +> .num_resources =3D ARRAY_SIZE(stmpe_ts_resources), > }; -> +> =20 > +/* > + * ADC (STMPE811) > + */ > + -> +static struct resource stmpe_adc_resources[] = { +> +static struct resource stmpe_adc_resources[] =3D { > + { -> + .name = "STMPE_TEMP_SENS", -> + .flags = IORESOURCE_IRQ, +> + .name =3D "STMPE_TEMP_SENS", +> + .flags =3D IORESOURCE_IRQ, > + }, > + { -> + .name = "STMPE_ADC", -> + .flags = IORESOURCE_IRQ, +> + .name =3D "STMPE_ADC", +> + .flags =3D IORESOURCE_IRQ, > + }, > +}; > + -> +static const struct mfd_cell stmpe_adc_cell = { -> + .name = "stmpe-adc", -> + .of_compatible = "st,stmpe-adc", -> + .resources = stmpe_adc_resources, -> + .num_resources = ARRAY_SIZE(stmpe_adc_resources), +> +static const struct mfd_cell stmpe_adc_cell =3D { +> + .name =3D "stmpe-adc", +> + .of_compatible =3D "st,stmpe-adc", +> + .resources =3D stmpe_adc_resources, +> + .num_resources =3D ARRAY_SIZE(stmpe_adc_resources), > +}; > + > /* > * STMPE811 or STMPE610 > */ -> @@ -497,6 +519,11 @@ static struct stmpe_variant_block stmpe811_blocks[] = { -> .irq = STMPE811_IRQ_TOUCH_DET, -> .block = STMPE_BLOCK_TOUCHSCREEN, +> @@ -497,6 +519,11 @@ static struct stmpe_variant_block stmpe811_blocks[] = +=3D { +> .irq =3D STMPE811_IRQ_TOUCH_DET, +> .block =3D STMPE_BLOCK_TOUCHSCREEN, > }, > + { -> + .cell = &stmpe_adc_cell, -> + .irq = STMPE811_IRQ_TEMP_SENS, -> + .block = STMPE_BLOCK_ADC, +> + .cell =3D &stmpe_adc_cell, +> + .irq =3D STMPE811_IRQ_TEMP_SENS, +> + .block =3D STMPE_BLOCK_ADC, > + }, > }; -> +> =20 > static int stmpe811_enable(struct stmpe *stmpe, unsigned int blocks, -> @@ -517,6 +544,44 @@ static int stmpe811_enable(struct stmpe *stmpe, unsigned int blocks, +> @@ -517,6 +544,44 @@ static int stmpe811_enable(struct stmpe *stmpe, unsi= +gned int blocks, > enable ? 0 : mask); > } -> +> =20 > +static int stmpe811_init_adc(struct stmpe *stmpe) > +{ > + int ret; > + u8 adc_ctrl1, adc_ctrl1_mask; > + -> + ret = stmpe_enable(stmpe, STMPE_BLOCK_ADC); +> + ret =3D stmpe_enable(stmpe, STMPE_BLOCK_ADC); > + if (ret) { > + dev_err(stmpe->dev, "Could not enable clock for ADC\n"); @@ -644,20 +651,20 @@ a comment here saying why. > + goto err_adc; > + } > + -> + adc_ctrl1 = STMPE_SAMPLE_TIME(stmpe->sample_time) | +> + adc_ctrl1 =3D STMPE_SAMPLE_TIME(stmpe->sample_time) | > + STMPE_MOD_12B(stmpe->mod_12b) | > + STMPE_REF_SEL(stmpe->ref_sel); -> + adc_ctrl1_mask = STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) | +> + adc_ctrl1_mask =3D STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) | > + STMPE_REF_SEL(0xff); > + -> + ret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1, +> + ret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1, > + adc_ctrl1_mask, adc_ctrl1); > + if (ret) { > + dev_err(stmpe->dev, "Could not setup ADC\n"); > + goto err_adc; > + } > + -> + ret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2, +> + ret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2, > + STMPE_ADC_FREQ(0xff), STMPE_ADC_FREQ(stmpe->adc_freq)); > + if (ret) { > + dev_err(stmpe->dev, "Could not setup ADC\n"); @@ -671,46 +678,49 @@ a comment here saying why. > + return ret; > +} > + -> static int stmpe811_get_altfunc(struct stmpe *stmpe, enum stmpe_block block) +> static int stmpe811_get_altfunc(struct stmpe *stmpe, enum stmpe_block bl= +ock) > { > /* 0 for touchscreen, 1 for GPIO */ > @@ -1235,6 +1300,12 @@ static int stmpe_chip_init(struct stmpe *stmpe) > return ret; > } -> -> + if (id == STMPE811_ID) { -> + ret = stmpe811_init_adc(stmpe); +> =20 +> + if (id =3D=3D STMPE811_ID) { +> + ret =3D stmpe811_init_adc(stmpe); > + if (ret) > + return ret; > + } > + > return stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_ICR_LSB], icr); > } -> -> @@ -1325,6 +1396,7 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum) -> struct device_node *np = ci->dev->of_node; +> =20 +> @@ -1325,6 +1396,7 @@ int stmpe_probe(struct stmpe_client_info *ci, enum = +stmpe_partnum partnum) +> struct device_node *np =3D ci->dev->of_node; > struct stmpe *stmpe; > int ret; > + u32 val; -> -> pdata = devm_kzalloc(ci->dev, sizeof(*pdata), GFP_KERNEL); +> =20 +> pdata =3D devm_kzalloc(ci->dev, sizeof(*pdata), GFP_KERNEL); > if (!pdata) -> @@ -1342,6 +1414,15 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum) +> @@ -1342,6 +1414,15 @@ int stmpe_probe(struct stmpe_client_info *ci, enum= + stmpe_partnum partnum) > mutex_init(&stmpe->irq_lock); > mutex_init(&stmpe->lock); -> +> =20 > + if (!of_property_read_u32(np, "st,sample-time", &val)) -> + stmpe->sample_time = val; +> + stmpe->sample_time =3D val; > + if (!of_property_read_u32(np, "st,mod-12b", &val)) -> + stmpe->mod_12b = val; +> + stmpe->mod_12b =3D val; > + if (!of_property_read_u32(np, "st,ref-sel", &val)) -> + stmpe->ref_sel = val; +> + stmpe->ref_sel =3D val; > + if (!of_property_read_u32(np, "st,adc-freq", &val)) -> + stmpe->adc_freq = val; +> + stmpe->adc_freq =3D val; > + -> stmpe->dev = ci->dev; -> stmpe->client = ci->client; -> stmpe->pdata = pdata; +> stmpe->dev =3D ci->dev; +> stmpe->client =3D ci->client; +> stmpe->pdata =3D pdata; > diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h > index c0353f6431f9..86dca9e9880a 100644 > --- a/include/linux/mfd/stmpe.h @@ -718,13 +728,13 @@ a comment here saying why. > @@ -21,6 +21,9 @@ > #define STMPE_I_DRIVE(x) (x & 0x1) > #define STMPE_OP_MODE(x) ((x & 0x7) << 1) -> +> =20 > +#define STMPE811_REG_ADC_CTRL1 0x20 > +#define STMPE811_REG_ADC_CTRL2 0x21 > + > struct device; > struct regulator; -> +> =20 > @@ -134,6 +137,12 @@ struct stmpe { > u8 ier[2]; > u8 oldier[2]; @@ -736,5 +746,5 @@ a comment here saying why. > + u8 ref_sel; > + u8 adc_freq; > }; -> +> =20 > extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data); diff --git a/a/content_digest b/N1/content_digest index 4cff97b..c01461b 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -23,19 +23,25 @@ Maxime Coquelin <mcoquelin.stm32@gmail.com> Peter Meerwald-Stadler <pmeerw@pmeerw.net> Lee Jones <lee.jones@linaro.org> - " Lars-P\0" + Lars-Peter Clausen <lars@metafoo.de> + Hartmut Knaack <knaack.h@gmx.de> + linux-arm-kernel@lists.infradead.org + Alexandre Torgue <alexandre.torgue@st.com> + Siddartha Mohanadoss <smohanad@codeaurora.org> + linux-kernel@vger.kernel.org + " Dmitry Torokhov <dmitry.torokhov@gmail.com>\0" "\00:1\0" "b\0" "On Fri, 23 Nov 2018 15:24:09 +0100\n" "Philippe Schenker <dev@pschenker.ch> wrote:\n" "\n" "> From: Stefan Agner <stefan@agner.ch>\n" - "> \n" + ">=20\n" "> This adds an ADC driver for the STMPE device using the industrial\n" "> input/output interface. The driver supports raw reading of values.\n" "> The driver depends on the MFD STMPE driver. If the touchscreen\n" "> block is enabled too, only four of the 8 ADC channels are available.\n" - "> \n" + ">=20\n" "> Signed-off-by: Stefan Agner <stefan@agner.ch>\n" "> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>\n" "> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>\n" @@ -59,11 +65,11 @@ "Jonathan\n" "\n" "> ---\n" - "> \n" + ">=20\n" "> Changes in v3:\n" "> - Undo ADC-settings related code-deletions in stmpe-ts.c that the code is\n" "> backwards-compatible to older devicetrees.\n" - "> \n" + ">=20\n" "> Changes in v2:\n" "> - Code formatting\n" "> - Move code to setup ADC to MFD device, as it is used by both drivers\n" @@ -71,10 +77,11 @@ "> - Removed unused includes\n" "> - Defined the macro STMPE_START_ONE_TEMP_CONV with other macros.\n" "> - Added new macro that defines the channel of the temperature sensor.\n" - "> Took new name for STMPE_MAX_ADC->STMPE_ADC_LAST_NR and used it throughout\n" + "> Took new name for STMPE_MAX_ADC->STMPE_ADC_LAST_NR and used it through=\n" + "out\n" "> the code for better readability.\n" "> - Added mutex_unlock where missing.\n" - "> \n" + ">=20\n" "> drivers/iio/adc/Kconfig | 7 +\n" "> drivers/iio/adc/Makefile | 1 +\n" "> drivers/iio/adc/stmpe-adc.c | 326 +++++++++++++++++++++++++++\n" @@ -84,7 +91,7 @@ "> include/linux/mfd/stmpe.h | 9 +\n" "> 7 files changed, 437 insertions(+), 26 deletions(-)\n" "> create mode 100644 drivers/iio/adc/stmpe-adc.c\n" - "> \n" + ">=20\n" "> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig\n" "> index a52fea8749a9..224f2067494d 100644\n" "> --- a/drivers/iio/adc/Kconfig\n" @@ -92,7 +99,7 @@ "> @@ -734,6 +734,13 @@ config STM32_DFSDM_ADC\n" "> \t This driver can also be built as a module. If so, the module\n" "> \t will be called stm32-dfsdm-adc.\n" - "> \n" + "> =20\n" "> +config STMPE_ADC\n" "> +\ttristate \"STMicroelectronics STMPE ADC driver\"\n" "> +\tdepends on OF && MFD_STMPE\n" @@ -107,14 +114,14 @@ "> index a6e6a0b659e2..cba889c30bf9 100644\n" "> --- a/drivers/iio/adc/Makefile\n" "> +++ b/drivers/iio/adc/Makefile\n" - "> @@ -69,6 +69,7 @@ obj-$(CONFIG_STM32_ADC_CORE) += stm32-adc-core.o\n" - "> obj-$(CONFIG_STM32_ADC) += stm32-adc.o\n" - "> obj-$(CONFIG_STM32_DFSDM_CORE) += stm32-dfsdm-core.o\n" - "> obj-$(CONFIG_STM32_DFSDM_ADC) += stm32-dfsdm-adc.o\n" - "> +obj-$(CONFIG_STMPE_ADC) += stmpe-adc.o\n" - "> obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o\n" - "> obj-$(CONFIG_TI_ADC0832) += ti-adc0832.o\n" - "> obj-$(CONFIG_TI_ADC084S021) += ti-adc084s021.o\n" + "> @@ -69,6 +69,7 @@ obj-$(CONFIG_STM32_ADC_CORE) +=3D stm32-adc-core.o\n" + "> obj-$(CONFIG_STM32_ADC) +=3D stm32-adc.o\n" + "> obj-$(CONFIG_STM32_DFSDM_CORE) +=3D stm32-dfsdm-core.o\n" + "> obj-$(CONFIG_STM32_DFSDM_ADC) +=3D stm32-dfsdm-adc.o\n" + "> +obj-$(CONFIG_STMPE_ADC) +=3D stmpe-adc.o\n" + "> obj-$(CONFIG_TI_ADC081C) +=3D ti-adc081c.o\n" + "> obj-$(CONFIG_TI_ADC0832) +=3D ti-adc0832.o\n" + "> obj-$(CONFIG_TI_ADC084S021) +=3D ti-adc084s021.o\n" "> diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c\n" "> new file mode 100644\n" "> index 000000000000..bea3f3c27bb5\n" @@ -185,7 +192,7 @@ "> +\t\t\t int *val2,\n" "> +\t\t\t long mask)\n" "> +{\n" - "> +\tstruct stmpe_adc *info = iio_priv(indio_dev);\n" + "> +\tstruct stmpe_adc *info =3D iio_priv(indio_dev);\n" "> +\tlong ret;\n" "> +\n" "> +\tswitch (mask) {\n" @@ -204,7 +211,7 @@ "in the private data structure that wasn't there!.\n" "\n" "> +\n" - "> +\t\tinfo->channel = (u8)chan->channel;\n" + "> +\t\tinfo->channel =3D (u8)chan->channel;\n" "> +\n" "> +\t\tswitch (chan->type) {\n" "> +\t\tcase IIO_VOLTAGE:\n" @@ -231,11 +238,11 @@ "> +\t\t\tstmpe_reg_write(info->stmpe, STMPE_REG_ADC_CAPT,\n" "> +\t\t\t\t\tSTMPE_ADC_CH(info->channel));\n" "> +\n" - "> +\t\t\t*val = info->value;\n" + "> +\t\t\t*val =3D info->value;\n" "> +\t\t\tbreak;\n" "> +\n" "> +\t\tcase IIO_TEMP:\n" - "> +\t\t\tif (info->channel != STMPE_TEMP_CHANNEL) {\n" + "> +\t\t\tif (info->channel !=3D STMPE_TEMP_CHANNEL) {\n" "> +\t\t\t\tmutex_unlock(&indio_dev->mlock);\n" "> +\t\t\t\treturn -EINVAL;\n" "> +\t\t\t}\n" @@ -248,12 +255,12 @@ "> +\t\t\treturn -EINVAL;\n" "> +\t\t}\n" "> +\n" - "> +\t\tret = wait_for_completion_interruptible_timeout\n" + "> +\t\tret =3D wait_for_completion_interruptible_timeout\n" "> +\t\t\t(&info->completion, STMPE_ADC_TIMEOUT);\n" "> +\n" - "> +\t\tif (ret <= 0) {\n" + "> +\t\tif (ret <=3D 0) {\n" "> +\t\t\tmutex_unlock(&indio_dev->mlock);\n" - "> +\t\t\tif (ret == 0)\n" + "> +\t\t\tif (ret =3D=3D 0)\n" "> +\t\t\t\treturn -ETIMEDOUT;\n" "> +\t\t\telse\n" "> +\t\t\t\treturn ret;\n" @@ -261,15 +268,15 @@ "> +\n" "> +\t\tswitch (chan->type) {\n" "> +\t\tcase IIO_VOLTAGE:\n" - "> +\t\t\t*val = info->value;\n" + "> +\t\t\t*val =3D info->value;\n" "> +\t\t\tbreak;\n" "> +\n" "> +\t\tcase IIO_TEMP:\n" "> +\t\t\t/*\n" - "> +\t\t\t * absolute temp = +V3.3 * value /7.51 [K]\n" - "> +\t\t\t * scale to [milli \302\260C]\n" + "> +\t\t\t * absolute temp =3D +V3.3 * value /7.51 [K]\n" + "> +\t\t\t * scale to [milli =C2=B0C]\n" "> +\t\t\t */\n" - "> +\t\t\t*val = ((449960l * info->value) / 1024l) - 273150;\n" + "> +\t\t\t*val =3D ((449960l * info->value) / 1024l) - 273150;\n" "> +\t\t\tbreak;\n" "> +\t\tdefault:\n" "> +\t\t\tbreak;\n" @@ -279,8 +286,8 @@ "> +\t\treturn IIO_VAL_INT;\n" "> +\n" "> +\tcase IIO_CHAN_INFO_SCALE:\n" - "> +\t\t*val = 3300;\n" - "> +\t\t*val2 = info->stmpe->mod_12b ? 12 : 10;\n" + "> +\t\t*val =3D 3300;\n" + "> +\t\t*val2 =3D info->stmpe->mod_12b ? 12 : 10;\n" "> +\t\treturn IIO_VAL_FRACTIONAL_LOG2;\n" "> +\n" "> +\tdefault:\n" @@ -292,16 +299,16 @@ "> +\n" "> +static irqreturn_t stmpe_adc_isr(int irq, void *dev_id)\n" "> +{\n" - "> +\tstruct stmpe_adc *info = (struct stmpe_adc *)dev_id;\n" + "> +\tstruct stmpe_adc *info =3D (struct stmpe_adc *)dev_id;\n" "> +\tu8 data[2];\n" "> +\n" "> +\tif (info->channel > STMPE_TEMP_CHANNEL)\n" "> +\t\treturn IRQ_NONE;\n" "> +\n" - "> +\tif (info->channel <= STMPE_ADC_LAST_NR) {\n" + "> +\tif (info->channel <=3D STMPE_ADC_LAST_NR) {\n" "> +\t\tint int_sta;\n" "> +\n" - "> +\t\tint_sta = stmpe_reg_read(info->stmpe, STMPE_REG_ADC_INT_STA);\n" + "> +\t\tint_sta =3D stmpe_reg_read(info->stmpe, STMPE_REG_ADC_INT_STA);\n" "> +\n" "> +\t\t/* Is the interrupt relevant */\n" "> +\t\tif (!(int_sta & STMPE_ADC_CH(info->channel)))\n" @@ -312,12 +319,12 @@ "> +\t\t\tSTMPE_REG_ADC_DATA_CH(info->channel), 2, data);\n" "> +\n" "> +\t\tstmpe_reg_write(info->stmpe, STMPE_REG_ADC_INT_STA, int_sta);\n" - "> +\t} else if (info->channel == STMPE_TEMP_CHANNEL) {\n" + "> +\t} else if (info->channel =3D=3D STMPE_TEMP_CHANNEL) {\n" "> +\t\t/* Read value */\n" "> +\t\tstmpe_block_read(info->stmpe, STMPE_REG_TEMP_DATA, 2, data);\n" "> +\t}\n" "> +\n" - "> +\tinfo->value = ((u32)data[0] << 8) + data[1];\n" + "> +\tinfo->value =3D ((u32)data[0] << 8) + data[1];\n" "\n" "This is an endian conversion of aligned data. Can we use an appropriate\n" "endian to cpu function to do it as cleaner and quite possibly a noop.\n" @@ -327,30 +334,30 @@ "> +\treturn IRQ_HANDLED;\n" "> +}\n" "> +\n" - "> +static const struct iio_info stmpe_adc_iio_info = {\n" - "> +\t.read_raw = &stmpe_read_raw,\n" + "> +static const struct iio_info stmpe_adc_iio_info =3D {\n" + "> +\t.read_raw =3D &stmpe_read_raw,\n" "> +};\n" "> +\n" "> +static void stmpe_adc_voltage_chan(struct iio_chan_spec *ics, int chan)\n" "> +{\n" - "> +\tics->type = IIO_VOLTAGE;\n" - "> +\tics->info_mask_separate = BIT(IIO_CHAN_INFO_RAW);\n" - "> +\tics->info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE);\n" - "> +\tics->indexed = 1;\n" - "> +\tics->channel = chan;\n" + "> +\tics->type =3D IIO_VOLTAGE;\n" + "> +\tics->info_mask_separate =3D BIT(IIO_CHAN_INFO_RAW);\n" + "> +\tics->info_mask_shared_by_type =3D BIT(IIO_CHAN_INFO_SCALE);\n" + "> +\tics->indexed =3D 1;\n" + "> +\tics->channel =3D chan;\n" "> +}\n" "> +\n" "> +static void stmpe_adc_temp_chan(struct iio_chan_spec *ics, int chan)\n" "> +{\n" - "> +\tics->type = IIO_TEMP;\n" - "> +\tics->info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED);\n" - "> +\tics->indexed = 1;\n" - "> +\tics->channel = chan;\n" + "> +\tics->type =3D IIO_TEMP;\n" + "> +\tics->info_mask_separate =3D BIT(IIO_CHAN_INFO_PROCESSED);\n" + "> +\tics->indexed =3D 1;\n" + "> +\tics->channel =3D chan;\n" "> +}\n" "> +\n" "> +static int stmpe_adc_init_hw(struct stmpe_adc *adc)\n" "> +{\n" - "> +\tstruct stmpe *stmpe = adc->stmpe;\n" + "> +\tstruct stmpe *stmpe =3D adc->stmpe;\n" "> +\n" "> +\t/* use temp irq for each conversion completion */\n" "> +\tstmpe_reg_write(stmpe, STMPE_REG_TEMP_TH, 0);\n" @@ -361,57 +368,58 @@ "> +\n" "> +static int stmpe_adc_probe(struct platform_device *pdev)\n" "> +{\n" - "> +\tstruct iio_dev *indio_dev = NULL;\n" - "> +\tstruct stmpe_adc *info = NULL;\n" + "> +\tstruct iio_dev *indio_dev =3D NULL;\n" + "> +\tstruct stmpe_adc *info =3D NULL;\n" "> +\tstruct device_node *np;\n" - "> +\tu32 norequest_mask = 0;\n" + "> +\tu32 norequest_mask =3D 0;\n" "> +\tint irq_temp, irq_adc;\n" - "> +\tint num_chan = 0;\n" - "> +\tint i = 0;\n" + "> +\tint num_chan =3D 0;\n" + "> +\tint i =3D 0;\n" "> +\tint ret;\n" "> +\n" - "> +\tirq_adc = platform_get_irq_byname(pdev, \"STMPE_ADC\");\n" + "> +\tirq_adc =3D platform_get_irq_byname(pdev, \"STMPE_ADC\");\n" "> +\tif (irq_adc < 0)\n" "> +\t\treturn irq_adc;\n" "> +\n" - "> +\tindio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct stmpe_adc));\n" + "> +\tindio_dev =3D devm_iio_device_alloc(&pdev->dev, sizeof(struct stmpe_adc=\n" + "));\n" "> +\tif (!indio_dev) {\n" "> +\t\tdev_err(&pdev->dev, \"failed allocating iio device\\n\");\n" "> +\t\treturn -ENOMEM;\n" "> +\t}\n" "> +\n" - "> +\tinfo = iio_priv(indio_dev);\n" + "> +\tinfo =3D iio_priv(indio_dev);\n" "> +\n" "> +\tinit_completion(&info->completion);\n" - "> +\tret = devm_request_threaded_irq(&pdev->dev, irq_adc, NULL,\n" + "> +\tret =3D devm_request_threaded_irq(&pdev->dev, irq_adc, NULL,\n" "> +\t\t\t\t\tstmpe_adc_isr, IRQF_ONESHOT,\n" "> +\t\t\t\t\t\"stmpe-adc\", info);\n" "> +\tif (ret < 0) {\n" - "> +\t\tdev_err(&pdev->dev, \"failed requesting irq, irq = %d\\n\",\n" + "> +\t\tdev_err(&pdev->dev, \"failed requesting irq, irq =3D %d\\n\",\n" "> +\t\t\t\tirq_adc);\n" "> +\t\treturn ret;\n" "> +\t}\n" "> +\n" - "> +\tirq_temp = platform_get_irq_byname(pdev, \"STMPE_TEMP_SENS\");\n" - "> +\tif (irq_temp >= 0) {\n" - "> +\t\tret = devm_request_threaded_irq(&pdev->dev, irq_temp, NULL,\n" + "> +\tirq_temp =3D platform_get_irq_byname(pdev, \"STMPE_TEMP_SENS\");\n" + "> +\tif (irq_temp >=3D 0) {\n" + "> +\t\tret =3D devm_request_threaded_irq(&pdev->dev, irq_temp, NULL,\n" "> +\t\t\t\t\t\tstmpe_adc_isr, IRQF_ONESHOT,\n" "> +\t\t\t\t\t\t\"stmpe-adc\", info);\n" "> +\t\tif (ret < 0)\n" "> +\t\t\tdev_warn(&pdev->dev, \"failed requesting irq for\"\n" - "> +\t\t\t\t \" temp sensor, irq = %d\\n\", irq_temp);\n" + "> +\t\t\t\t \" temp sensor, irq =3D %d\\n\", irq_temp);\n" "> +\t}\n" "> +\n" "> +\tplatform_set_drvdata(pdev, indio_dev);\n" "> +\n" - "> +\tindio_dev->name\t\t= dev_name(&pdev->dev);\n" - "> +\tindio_dev->dev.parent\t= &pdev->dev;\n" - "> +\tindio_dev->info\t\t= &stmpe_adc_iio_info;\n" - "> +\tindio_dev->modes\t= INDIO_DIRECT_MODE;\n" + "> +\tindio_dev->name\t\t=3D dev_name(&pdev->dev);\n" + "> +\tindio_dev->dev.parent\t=3D &pdev->dev;\n" + "> +\tindio_dev->info\t\t=3D &stmpe_adc_iio_info;\n" + "> +\tindio_dev->modes\t=3D INDIO_DIRECT_MODE;\n" "> +\n" - "> +\tinfo->stmpe = dev_get_drvdata(pdev->dev.parent);\n" + "> +\tinfo->stmpe =3D dev_get_drvdata(pdev->dev.parent);\n" "> +\n" - "> +\tnp = pdev->dev.of_node;\n" + "> +\tnp =3D pdev->dev.of_node;\n" "> +\n" "> +\tif (!np)\n" "> +\t\tdev_err(&pdev->dev, \"no device tree node found\\n\");\n" @@ -425,10 +433,10 @@ "> +\t}\n" "> +\tstmpe_adc_temp_chan(&info->stmpe_adc_iio_channels[num_chan], i);\n" "> +\tnum_chan++;\n" - "> +\tindio_dev->channels = info->stmpe_adc_iio_channels;\n" - "> +\tindio_dev->num_channels = num_chan;\n" + "> +\tindio_dev->channels =3D info->stmpe_adc_iio_channels;\n" + "> +\tindio_dev->num_channels =3D num_chan;\n" "> +\n" - "> +\tret = stmpe_adc_init_hw(info);\n" + "> +\tret =3D stmpe_adc_init_hw(info);\n" "> +\tif (ret)\n" "> +\t\treturn ret;\n" "> +\n" @@ -437,8 +445,8 @@ "> +\n" "> +static int stmpe_adc_remove(struct platform_device *pdev)\n" "> +{\n" - "> +\tstruct iio_dev *indio_dev = platform_get_drvdata(pdev);\n" - "> +\tstruct stmpe_adc *info = iio_priv(indio_dev);\n" + "> +\tstruct iio_dev *indio_dev =3D platform_get_drvdata(pdev);\n" + "> +\tstruct stmpe_adc *info =3D iio_priv(indio_dev);\n" "> +\n" "> +\tiio_device_unregister(indio_dev);\n" "> +\tstmpe_disable(info->stmpe, STMPE_BLOCK_ADC);\n" @@ -458,8 +466,8 @@ "> +\n" "> +static int __maybe_unused stmpe_adc_resume(struct device *dev)\n" "> +{\n" - "> +\tstruct iio_dev *indio_dev = dev_get_drvdata(dev);\n" - "> +\tstruct stmpe_adc *info = iio_priv(indio_dev);\n" + "> +\tstruct iio_dev *indio_dev =3D dev_get_drvdata(dev);\n" + "> +\tstruct stmpe_adc *info =3D iio_priv(indio_dev);\n" "> +\n" "> +\tstmpe_adc_init_hw(info);\n" "> +\n" @@ -468,12 +476,12 @@ "> +\n" "> +static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);\n" "> +\n" - "> +static struct platform_driver stmpe_adc_driver = {\n" - "> +\t.probe\t\t= stmpe_adc_probe,\n" - "> +\t.remove\t\t= stmpe_adc_remove,\n" - "> +\t.driver\t\t= {\n" - "> +\t\t.name\t= \"stmpe-adc\",\n" - "> +\t\t.pm\t= &stmpe_adc_pm_ops,\n" + "> +static struct platform_driver stmpe_adc_driver =3D {\n" + "> +\t.probe\t\t=3D stmpe_adc_probe,\n" + "> +\t.remove\t\t=3D stmpe_adc_remove,\n" + "> +\t.driver\t\t=3D {\n" + "> +\t\t.name\t=3D \"stmpe-adc\",\n" + "> +\t\t.pm\t=3D &stmpe_adc_pm_ops,\n" "> +\t},\n" "> +};\n" "> +\n" @@ -483,7 +491,8 @@ "> +MODULE_DESCRIPTION(\"STMPEXXX ADC driver\");\n" "> +MODULE_LICENSE(\"GPL v2\");\n" "> +MODULE_ALIAS(\"platform:stmpe-adc\");\n" - "> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c\n" + "> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchsc=\n" + "reen/stmpe-ts.c\n" "> index c5d9006588a2..81aa313d6e5a 100644\n" "> --- a/drivers/input/touchscreen/stmpe-ts.c\n" "> +++ b/drivers/input/touchscreen/stmpe-ts.c\n" @@ -523,71 +532,73 @@ "> \tu8 ave_ctrl;\n" "> \tu8 touch_det_delay;\n" "> \tu8 settling;\n" - "> @@ -176,7 +161,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data)\n" + "> @@ -176,7 +161,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *da=\n" + "ta)\n" "> \tinput_report_key(ts->idev, BTN_TOUCH, 1);\n" "> \tinput_sync(ts->idev);\n" - "> \n" + "> =20\n" "> - /* flush the FIFO after we have read out our values. */\n" "> +\t/* flush the FIFO after we have read out our values. */\n" "> \t__stmpe_reset_fifo(ts->stmpe);\n" - "> \n" + "> =20\n" "> \t/* reenable the tsc */\n" "> @@ -202,20 +187,21 @@ static int stmpe_init_hw(struct stmpe_touch *ts)\n" "> \t\treturn ret;\n" "> \t}\n" - "> \n" - "> -\tadc_ctrl1 = STMPE_SAMPLE_TIME(ts->sample_time) |\n" + "> =20\n" + "> -\tadc_ctrl1 =3D STMPE_SAMPLE_TIME(ts->sample_time) |\n" "> -\t\t STMPE_MOD_12B(ts->mod_12b) | STMPE_REF_SEL(ts->ref_sel);\n" - "> +\tadc_ctrl1 = STMPE_SAMPLE_TIME(stmpe->sample_time) |\n" + "> +\tadc_ctrl1 =3D STMPE_SAMPLE_TIME(stmpe->sample_time) |\n" "> +\t\t STMPE_MOD_12B(stmpe->mod_12b) |\n" "> +\t\t STMPE_REF_SEL(stmpe->ref_sel);\n" "\n" "Could we split this refactor out 'ahead' of the ADC patch?\n" "\n" - "> \tadc_ctrl1_mask = STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) |\n" + "> \tadc_ctrl1_mask =3D STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) |\n" "> \t\t\t STMPE_REF_SEL(0xff);\n" - "> \n" - "> -\tret = stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL1,\n" - "> +\tret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1,\n" + "> =20\n" + "> -\tret =3D stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL1,\n" + "> +\tret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1,\n" "> \t\t\tadc_ctrl1_mask, adc_ctrl1);\n" "> \tif (ret) {\n" "> \t\tdev_err(dev, \"Could not setup ADC\\n\");\n" "> \t\treturn ret;\n" "> \t}\n" - "> \n" - "> -\tret = stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL2,\n" + "> =20\n" + "> -\tret =3D stmpe_set_bits(stmpe, STMPE_REG_ADC_CTRL2,\n" "> -\t\t\tSTMPE_ADC_FREQ(0xff), STMPE_ADC_FREQ(ts->adc_freq));\n" - "> +\tret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2,\n" + "> +\tret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2,\n" "> +\t\t\tSTMPE_ADC_FREQ(0xff), STMPE_ADC_FREQ(stmpe->adc_freq));\n" "> \tif (ret) {\n" "> \t\tdev_err(dev, \"Could not setup ADC\\n\");\n" "> \t\treturn ret;\n" - "> @@ -295,13 +281,13 @@ static void stmpe_ts_get_platform_info(struct platform_device *pdev,\n" - "> \n" + "> @@ -295,13 +281,13 @@ static void stmpe_ts_get_platform_info(struct platf=\n" + "orm_device *pdev,\n" + "> =20\n" "> \tif (np) {\n" "> \t\tif (!of_property_read_u32(np, \"st,sample-time\", &val))\n" - "> -\t\t\tts->sample_time = val;\n" - "> +\t\t\tts->stmpe->sample_time = val;\n" + "> -\t\t\tts->sample_time =3D val;\n" + "> +\t\t\tts->stmpe->sample_time =3D val;\n" "> \t\tif (!of_property_read_u32(np, \"st,mod-12b\", &val))\n" - "> -\t\t\tts->mod_12b = val;\n" - "> +\t\t\tts->stmpe->mod_12b = val;\n" + "> -\t\t\tts->mod_12b =3D val;\n" + "> +\t\t\tts->stmpe->mod_12b =3D val;\n" "> \t\tif (!of_property_read_u32(np, \"st,ref-sel\", &val))\n" - "> -\t\t\tts->ref_sel = val;\n" - "> +\t\t\tts->stmpe->ref_sel = val;\n" + "> -\t\t\tts->ref_sel =3D val;\n" + "> +\t\t\tts->stmpe->ref_sel =3D val;\n" "> \t\tif (!of_property_read_u32(np, \"st,adc-freq\", &val))\n" - "> -\t\t\tts->adc_freq = val;\n" - "> +\t\t\tts->stmpe->adc_freq = val;\n" + "> -\t\t\tts->adc_freq =3D val;\n" + "> +\t\t\tts->stmpe->adc_freq =3D val;\n" "> \t\tif (!of_property_read_u32(np, \"st,ave-ctrl\", &val))\n" - "> \t\t\tts->ave_ctrl = val;\n" + "> \t\t\tts->ave_ctrl =3D val;\n" "> \t\tif (!of_property_read_u32(np, \"st,touch-det-delay\", &val))\n" "> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig\n" "> index 8c5dfdce4326..bba159e8eaa4 100644\n" "> --- a/drivers/mfd/Kconfig\n" "> +++ b/drivers/mfd/Kconfig\n" "> @@ -1204,7 +1204,7 @@ config MFD_STMPE\n" - "> \n" + "> =20\n" "> \t Currently supported devices are:\n" - "> \n" + "> =20\n" "> -\t\tSTMPE811: GPIO, Touchscreen\n" "> +\t\tSTMPE811: GPIO, Touchscreen, ADC\n" "> \t\tSTMPE1601: GPIO, Keypad\n" @@ -598,64 +609,66 @@ "> \t\tKeypad: stmpe-keypad\n" "> \t\tTouchscreen: stmpe-ts\n" "> +\t\tADC: stmpe-adc\n" - "> \n" + "> =20\n" "> menu \"STMicroelectronics STMPE Interface Drivers\"\n" "> depends on MFD_STMPE\n" "> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c\n" "> index 566caca4efd8..35390d1c2e64 100644\n" "> --- a/drivers/mfd/stmpe.c\n" "> +++ b/drivers/mfd/stmpe.c\n" - "> @@ -463,6 +463,28 @@ static const struct mfd_cell stmpe_ts_cell = {\n" - "> \t.num_resources\t= ARRAY_SIZE(stmpe_ts_resources),\n" + "> @@ -463,6 +463,28 @@ static const struct mfd_cell stmpe_ts_cell =3D {\n" + "> \t.num_resources\t=3D ARRAY_SIZE(stmpe_ts_resources),\n" "> };\n" - "> \n" + "> =20\n" "> +/*\n" "> + * ADC (STMPE811)\n" "> + */\n" "> +\n" - "> +static struct resource stmpe_adc_resources[] = {\n" + "> +static struct resource stmpe_adc_resources[] =3D {\n" "> +\t{\n" - "> +\t\t.name\t= \"STMPE_TEMP_SENS\",\n" - "> +\t\t.flags\t= IORESOURCE_IRQ,\n" + "> +\t\t.name\t=3D \"STMPE_TEMP_SENS\",\n" + "> +\t\t.flags\t=3D IORESOURCE_IRQ,\n" "> +\t},\n" "> +\t{\n" - "> +\t\t.name\t= \"STMPE_ADC\",\n" - "> +\t\t.flags\t= IORESOURCE_IRQ,\n" + "> +\t\t.name\t=3D \"STMPE_ADC\",\n" + "> +\t\t.flags\t=3D IORESOURCE_IRQ,\n" "> +\t},\n" "> +};\n" "> +\n" - "> +static const struct mfd_cell stmpe_adc_cell = {\n" - "> +\t.name\t\t= \"stmpe-adc\",\n" - "> +\t.of_compatible\t= \"st,stmpe-adc\",\n" - "> +\t.resources\t= stmpe_adc_resources,\n" - "> +\t.num_resources\t= ARRAY_SIZE(stmpe_adc_resources),\n" + "> +static const struct mfd_cell stmpe_adc_cell =3D {\n" + "> +\t.name\t\t=3D \"stmpe-adc\",\n" + "> +\t.of_compatible\t=3D \"st,stmpe-adc\",\n" + "> +\t.resources\t=3D stmpe_adc_resources,\n" + "> +\t.num_resources\t=3D ARRAY_SIZE(stmpe_adc_resources),\n" "> +};\n" "> +\n" "> /*\n" "> * STMPE811 or STMPE610\n" "> */\n" - "> @@ -497,6 +519,11 @@ static struct stmpe_variant_block stmpe811_blocks[] = {\n" - "> \t\t.irq\t= STMPE811_IRQ_TOUCH_DET,\n" - "> \t\t.block\t= STMPE_BLOCK_TOUCHSCREEN,\n" + "> @@ -497,6 +519,11 @@ static struct stmpe_variant_block stmpe811_blocks[] =\n" + "=3D {\n" + "> \t\t.irq\t=3D STMPE811_IRQ_TOUCH_DET,\n" + "> \t\t.block\t=3D STMPE_BLOCK_TOUCHSCREEN,\n" "> \t},\n" "> +\t{\n" - "> +\t\t.cell\t= &stmpe_adc_cell,\n" - "> +\t\t.irq\t= STMPE811_IRQ_TEMP_SENS,\n" - "> +\t\t.block\t= STMPE_BLOCK_ADC,\n" + "> +\t\t.cell\t=3D &stmpe_adc_cell,\n" + "> +\t\t.irq\t=3D STMPE811_IRQ_TEMP_SENS,\n" + "> +\t\t.block\t=3D STMPE_BLOCK_ADC,\n" "> +\t},\n" "> };\n" - "> \n" + "> =20\n" "> static int stmpe811_enable(struct stmpe *stmpe, unsigned int blocks,\n" - "> @@ -517,6 +544,44 @@ static int stmpe811_enable(struct stmpe *stmpe, unsigned int blocks,\n" + "> @@ -517,6 +544,44 @@ static int stmpe811_enable(struct stmpe *stmpe, unsi=\n" + "gned int blocks,\n" "> \t\t\t\tenable ? 0 : mask);\n" "> }\n" - "> \n" + "> =20\n" "> +static int stmpe811_init_adc(struct stmpe *stmpe)\n" "> +{\n" "> +\tint ret;\n" "> +\tu8 adc_ctrl1, adc_ctrl1_mask;\n" "> +\n" - "> +\tret = stmpe_enable(stmpe, STMPE_BLOCK_ADC);\n" + "> +\tret =3D stmpe_enable(stmpe, STMPE_BLOCK_ADC);\n" "> +\tif (ret) {\n" "> +\t\tdev_err(stmpe->dev, \"Could not enable clock for ADC\\n\");\n" "\n" @@ -672,20 +685,20 @@ "> +\t\tgoto err_adc;\n" "> +\t}\n" "> +\n" - "> +\tadc_ctrl1 = STMPE_SAMPLE_TIME(stmpe->sample_time) |\n" + "> +\tadc_ctrl1 =3D STMPE_SAMPLE_TIME(stmpe->sample_time) |\n" "> +\t\t STMPE_MOD_12B(stmpe->mod_12b) |\n" "> +\t\t STMPE_REF_SEL(stmpe->ref_sel);\n" - "> +\tadc_ctrl1_mask = STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) |\n" + "> +\tadc_ctrl1_mask =3D STMPE_SAMPLE_TIME(0xff) | STMPE_MOD_12B(0xff) |\n" "> +\t\t\t STMPE_REF_SEL(0xff);\n" "> +\n" - "> +\tret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1,\n" + "> +\tret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL1,\n" "> +\t\t\tadc_ctrl1_mask, adc_ctrl1);\n" "> +\tif (ret) {\n" "> +\t\tdev_err(stmpe->dev, \"Could not setup ADC\\n\");\n" "> +\t\tgoto err_adc;\n" "> +\t}\n" "> +\n" - "> +\tret = stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2,\n" + "> +\tret =3D stmpe_set_bits(stmpe, STMPE811_REG_ADC_CTRL2,\n" "> +\t\t\tSTMPE_ADC_FREQ(0xff), STMPE_ADC_FREQ(stmpe->adc_freq));\n" "> +\tif (ret) {\n" "> +\t\tdev_err(stmpe->dev, \"Could not setup ADC\\n\");\n" @@ -699,46 +712,49 @@ "> +\treturn ret;\n" "> +}\n" "> +\n" - "> static int stmpe811_get_altfunc(struct stmpe *stmpe, enum stmpe_block block)\n" + "> static int stmpe811_get_altfunc(struct stmpe *stmpe, enum stmpe_block bl=\n" + "ock)\n" "> {\n" "> \t/* 0 for touchscreen, 1 for GPIO */\n" "> @@ -1235,6 +1300,12 @@ static int stmpe_chip_init(struct stmpe *stmpe)\n" "> \t\t\treturn ret;\n" "> \t}\n" - "> \n" - "> +\tif (id == STMPE811_ID) {\n" - "> +\t\tret = stmpe811_init_adc(stmpe);\n" + "> =20\n" + "> +\tif (id =3D=3D STMPE811_ID) {\n" + "> +\t\tret =3D stmpe811_init_adc(stmpe);\n" "> +\t\tif (ret)\n" "> +\t\t\treturn ret;\n" "> +\t}\n" "> +\n" "> \treturn stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_ICR_LSB], icr);\n" "> }\n" - "> \n" - "> @@ -1325,6 +1396,7 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)\n" - "> \tstruct device_node *np = ci->dev->of_node;\n" + "> =20\n" + "> @@ -1325,6 +1396,7 @@ int stmpe_probe(struct stmpe_client_info *ci, enum =\n" + "stmpe_partnum partnum)\n" + "> \tstruct device_node *np =3D ci->dev->of_node;\n" "> \tstruct stmpe *stmpe;\n" "> \tint ret;\n" "> +\tu32 val;\n" - "> \n" - "> \tpdata = devm_kzalloc(ci->dev, sizeof(*pdata), GFP_KERNEL);\n" + "> =20\n" + "> \tpdata =3D devm_kzalloc(ci->dev, sizeof(*pdata), GFP_KERNEL);\n" "> \tif (!pdata)\n" - "> @@ -1342,6 +1414,15 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)\n" + "> @@ -1342,6 +1414,15 @@ int stmpe_probe(struct stmpe_client_info *ci, enum=\n" + " stmpe_partnum partnum)\n" "> \tmutex_init(&stmpe->irq_lock);\n" "> \tmutex_init(&stmpe->lock);\n" - "> \n" + "> =20\n" "> +\tif (!of_property_read_u32(np, \"st,sample-time\", &val))\n" - "> +\t\tstmpe->sample_time = val;\n" + "> +\t\tstmpe->sample_time =3D val;\n" "> +\tif (!of_property_read_u32(np, \"st,mod-12b\", &val))\n" - "> +\t\tstmpe->mod_12b = val;\n" + "> +\t\tstmpe->mod_12b =3D val;\n" "> +\tif (!of_property_read_u32(np, \"st,ref-sel\", &val))\n" - "> +\t\tstmpe->ref_sel = val;\n" + "> +\t\tstmpe->ref_sel =3D val;\n" "> +\tif (!of_property_read_u32(np, \"st,adc-freq\", &val))\n" - "> +\t\tstmpe->adc_freq = val;\n" + "> +\t\tstmpe->adc_freq =3D val;\n" "> +\n" - "> \tstmpe->dev = ci->dev;\n" - "> \tstmpe->client = ci->client;\n" - "> \tstmpe->pdata = pdata;\n" + "> \tstmpe->dev =3D ci->dev;\n" + "> \tstmpe->client =3D ci->client;\n" + "> \tstmpe->pdata =3D pdata;\n" "> diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h\n" "> index c0353f6431f9..86dca9e9880a 100644\n" "> --- a/include/linux/mfd/stmpe.h\n" @@ -746,13 +762,13 @@ "> @@ -21,6 +21,9 @@\n" "> #define STMPE_I_DRIVE(x)\t(x & 0x1)\n" "> #define STMPE_OP_MODE(x)\t((x & 0x7) << 1)\n" - "> \n" + "> =20\n" "> +#define STMPE811_REG_ADC_CTRL1\t0x20\n" "> +#define STMPE811_REG_ADC_CTRL2\t0x21\n" "> +\n" "> struct device;\n" "> struct regulator;\n" - "> \n" + "> =20\n" "> @@ -134,6 +137,12 @@ struct stmpe {\n" "> \tu8 ier[2];\n" "> \tu8 oldier[2];\n" @@ -764,7 +780,7 @@ "> +\tu8 ref_sel;\n" "> +\tu8 adc_freq;\n" "> };\n" - "> \n" + "> =20\n" > extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data); -e5549eb2539b0b49be09a02031ac70816a2e5d2c638ebe18add8bc088827c15c +6853c571b989a406a863419b21b3269755ce5618603ad5b3831f8d2f6430d5ec
diff --git a/a/1.txt b/N2/1.txt index eed657b..93b4267 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -239,7 +239,7 @@ helps! > + case IIO_TEMP: > + /* > + * absolute temp = +V3.3 * value /7.51 [K] -> + * scale to [milli °C] +> + * scale to [milli ?C] > + */ > + *val = ((449960l * info->value) / 1024l) - 273150; > + break; diff --git a/a/content_digest b/N2/content_digest index 4cff97b..4a68975 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -1,29 +1,9 @@ "ref\020181123142411.8921-1-dev@pschenker.ch\0" "ref\020181123142411.8921-2-dev@pschenker.ch\0" - "From\0Jonathan Cameron <jic23@kernel.org>\0" - "Subject\0Re: [PATCH v3 2/4] iio: adc: add STMPE ADC driver using IIO framework\0" + "From\0jic23@kernel.org (Jonathan Cameron)\0" + "Subject\0[PATCH v3 2/4] iio: adc: add STMPE ADC driver using IIO framework\0" "Date\0Sun, 25 Nov 2018 10:27:57 +0000\0" - "To\0Philippe Schenker <dev@pschenker.ch>\0" - "Cc\0marcel.ziswiler@toradex.com" - stefan@agner.ch - Max Krummenacher <max.krummenacher@toradex.com> - Philippe Schenker <philippe.schenker@toradex.com> - Mark Brown <broonie@kernel.org> - Arnaud Pouliquen <arnaud.pouliquen@st.com> - linux-iio@vger.kernel.org - Geert Uytterhoeven <geert@linux-m68k.org> - William Breathitt Gray <vilhelm.gray@gmail.com> - linux-stm32@st-md-mailman.stormreply.com - Baolin Wang <baolin.wang@linaro.org> - Randy Dunlap <rdunlap@infradead.org> - Marcus Folkesson <marcus.folkesson@gmail.com> - Freeman Liu <freeman.liu@spreadtrum.com> - linux-input@vger.kernel.org - Eugen Hristev <eugen.hristev@microchip.com> - Maxime Coquelin <mcoquelin.stm32@gmail.com> - Peter Meerwald-Stadler <pmeerw@pmeerw.net> - Lee Jones <lee.jones@linaro.org> - " Lars-P\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "On Fri, 23 Nov 2018 15:24:09 +0100\n" @@ -267,7 +247,7 @@ "> +\t\tcase IIO_TEMP:\n" "> +\t\t\t/*\n" "> +\t\t\t * absolute temp = +V3.3 * value /7.51 [K]\n" - "> +\t\t\t * scale to [milli \302\260C]\n" + "> +\t\t\t * scale to [milli ?C]\n" "> +\t\t\t */\n" "> +\t\t\t*val = ((449960l * info->value) / 1024l) - 273150;\n" "> +\t\t\tbreak;\n" @@ -767,4 +747,4 @@ "> \n" > extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data); -e5549eb2539b0b49be09a02031ac70816a2e5d2c638ebe18add8bc088827c15c +a3c21555ebd710001f0b03955e2e4623abc1943fc6b7c88d77f2c47c8d95875c
diff --git a/a/content_digest b/N3/content_digest index 4cff97b..0990ca8 100644 --- a/a/content_digest +++ b/N3/content_digest @@ -23,7 +23,13 @@ Maxime Coquelin <mcoquelin.stm32@gmail.com> Peter Meerwald-Stadler <pmeerw@pmeerw.net> Lee Jones <lee.jones@linaro.org> - " Lars-P\0" + Lars-Peter Clausen <lars@metafoo.de> + Hartmut Knaack <knaack.h@gmx.de> + linux-arm-kernel@lists.infradead.org + Alexandre Torgue <alexandre.torgue@st.com> + Siddartha Mohanadoss <smohanad@codeaurora.org> + linux-kernel@vger.kernel.org + " Dmitry Torokhov <dmitry.torokhov@gmail.com>\0" "\00:1\0" "b\0" "On Fri, 23 Nov 2018 15:24:09 +0100\n" @@ -767,4 +773,4 @@ "> \n" > extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data); -e5549eb2539b0b49be09a02031ac70816a2e5d2c638ebe18add8bc088827c15c +dd61b3df548e453597eda098615bf72a222833c88d60b00ed37f0fce2f1f8193
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.