mxs-lradc: Split driver into MFD
Subsystems (6)
v15 cover mxs-lradc: Split driver into MFD
Split existing driver mxs-lradc into MFD with touchscreen and IIO part.
Tested on I.MX28
Ksenija Stanojevic (5):
mfd: mxs-lradc: Add support for mxs-lradc MFD
iio: adc: mxs-lradc: Add support for adc driver
input: touchscreen: mxs-lradc: Add support for touchscreen
iio: adc: mxs-lradc: Remove driver
mfd: Move binding document
.../bindings/{iio/adc => mfd}/mxs-lradc.txt | 0
drivers/iio/adc/Kconfig | 27 +-
drivers/iio/adc/Makefile | 2 +-
drivers/iio/adc/mxs-lradc-adc.c | 843 ++++++++++
drivers/iio/adc/mxs-lradc.c | 1750 --------------------
drivers/input/touchscreen/Kconfig | 10 +
drivers/input/touchscreen/Makefile | 1 +
drivers/input/touchscreen/mxs-lradc-ts.c | 714 ++++++++
drivers/mfd/Kconfig | 17 +
drivers/mfd/Makefile | 1 +
drivers/mfd/mxs-lradc.c | 267 +++
include/linux/mfd/mxs-lradc.h | 187 +++
12 files changed, 2054 insertions(+), 1765 deletions(-)
rename Documentation/devicetree/bindings/{iio/adc => mfd}/mxs-lradc.txt (100%)
create mode 100644 drivers/iio/adc/mxs-lradc-adc.c
delete mode 100644 drivers/iio/adc/mxs-lradc.c
create mode 100644 drivers/input/touchscreen/mxs-lradc-ts.c
create mode 100644 drivers/mfd/mxs-lradc.c
create mode 100644 include/linux/mfd/mxs-lradc.hSignature · 1 line
1.9.1
PATCH v15 1/5 mfd: mxs-lradc: Add support for mxs-lradc MFD
Add core files for low resolution analog-to-digital converter (mxs-lradc) MFD driver.
---
Changes in v15:
- if hardware doesn't contain touchscreen don't load touchscreen driver.
Changes in v14:
- none
Changes in v13:
- none
Changes in v12:
- use BIT macro
Changes in v11:
- create static struct mfd_cells
- don't set platform data in mfd cells, set driver data instead
- remove mxs_lradc_reg_* functions, use writel function instead
Changes in v10:
- fetch base address from DT
- add a NULL check for of_match_device
Changes in v9:
- improve commit message.
Changes in v8:
- rebase onto 4.9-rc1
Changes in v7:
- define macros ADC_CELL and TSC_CELL
- remove one cell and dynamically set them in the switch()
- fail in the touchscreen driver instead of mfd driver if hardware doesn't contain a touchscreen
Changes in v6:
- update copyright
- add kernel-doc header for struct mxs-lradc
- add error message
- change EINVAL to ENODEV
- use PLATFORM_DEVID_NONE instead -1
- cosmetic fixes
Changes in v5:
- use DEFINE_RES_MEM
- don't pass ioreammaped adress to platform cells
- move comment outside of struct mxs_lradc
- change type of argument in mxs_lradc_reg_set, mxs_lradc_reg_clear, mxs_lradc_reg_wrt (struct mxs_lradc * -> void __iomem *)
Changes in v4:
- update copyright
- use DEFINE_RES_IRQ_NAMED
- remove mxs_lradc_add_device function
- use struct mfd_cell in static form
- improve spacing
- remove unnecessary comment
- remove platform_get_irq
- remove touch_ret and use ret instead
- rename use_touchscreen to touchscreen_wire
- use goto statements
- remove irq[13], irq_count and irq_name from struct mxs_lradc
- remove all defines from inside the struct definition
Changes in v3:
- add note to commit message
- move switch statement into if(touch_ret == 0) branch
- add MODULE_AUTHOR
Changes in v2:
- do not change spacing in Kconfig
- make struct mfd_cell part of struct mxs_lradc
- use switch instead of if in mxs_lradc_irq_mask
- use only necessary header files in mxs_lradc.h
- use devm_mfd_add_device
- use separate function to register mfd device
- change licence to GPL
- add copyright
drivers/mfd/Kconfig | 17 +++ drivers/mfd/Makefile | 1 + drivers/mfd/mxs-lradc.c | 267 ++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/mxs-lradc.h | 187 +++++++++++++++++++++++++++++ 4 files changed, 472 insertions(+) create mode 100644 drivers/mfd/mxs-lradc.c create mode 100644 include/linux/mfd/mxs-lradc.h
drivers/mfd/Kconfig +17 -0
@@ -344,6 +344,23 @@ config MFD_MC13XXX_I2C help Select this if your MC13xxx is connected via an I2C bus. +config MFD_MXS_LRADC + tristate "Freescale i.MX23/i.MX28 LRADC" + depends on ARCH_MXS || COMPILE_TEST + select MFD_CORE + select STMP_DEVICE + help + Say yes here to build support for the Low Resolution + Analog-to-Digital Converter (LRADC) found on the i.MX23 and i.MX28 + processors. This driver provides common support for accessing the + device, additional drivers must be enabled in order to use the + functionality of the device: + mxs-lradc-adc for ADC readings + mxs-lradc-ts for touchscreen support + + This driver can also be built as a module. If so, the module will be + called mxs-lradc. + config MFD_MX25_TSADC tristate "Freescale i.MX25 integrated Touchscreen and ADC unit" select REGMAP_MMIO
drivers/mfd/Makefile +1 -0
@@ -215,3 +215,4 @@ obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o obj-$(CONFIG_MFD_SUN4I_GPADC) += sun4i-gpadc.o obj-$(CONFIG_MFD_STM32_TIMERS) += stm32-timers.o +obj-$(CONFIG_MFD_MXS_LRADC) += mxs-lradc.o
drivers/mfd/mxs-lradc.c new file +267 -0
267 lines not on this page · raw message
include/linux/mfd/mxs-lradc.h new file +187 -0
187 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v15 2/5 iio: adc: mxs-lradc: Add support for adc driver
In reply to Ksenija StanojevicAdd support for sixteen-channel 12-bit resolution ADC and its functions, which include general-purpose ADC readings, battery voltage measurement, and die temperature measurement.
---
Changes in v15:
- none
Changes in v14:
- fix checkpatch warnings
Changes in v13:
- none
Changes in v12:
- none
Changes in v11:
- use dev_get_drvdata instead dev_get_platdata
- use writel instead mxs_lradc_reg_* functions
Changes in v10:
- none
Changes in v9:
- none
Changes in v8:
- rebase onto 4.9-rc1
Changes in v7:
- none
Changes in v6:
- update copyright
Changes in v5:
- add field void __iomem *base to struct mxs_lradc_adc
- change arguments in all functions for accessing I/O memory to follow the previous change.
- use devm_ioremap for mapping I/O memory
Changes in v4:
- update copyright
- use platform_get_irq_byname
- use irq_of_parse_and_map
Changes in v3:
- make buffer large enough for timestamps
- remove unnecessary blank lines
Changes in v2:
- improve commit message
- do not change spacing in Kconfig
- impove formating
- remove wrapper show_scale_avail
- use correct syntax for comments
- use devm_iio_trigger_alloc
- do not allocate buffer dynamically
- use iio_device_claim_*_mode helpers
- add spinlock in struct mxs_lradc_ts to enable locking in interrupt handler
- only grab irqs that are relevant to adc
- remove blank line at the end of the file
- change licence to GPL
- add copyright
drivers/iio/adc/Kconfig | 13 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/mxs-lradc-adc.c | 843 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 857 insertions(+) create mode 100644 drivers/iio/adc/mxs-lradc-adc.c
drivers/iio/adc/Kconfig +13 -0
@@ -229,6 +229,19 @@ config EXYNOS_ADC To compile this driver as a module, choose M here: the module will be called exynos_adc. +config MXS_LRADC_ADC + tristate "Freescale i.MX23/i.MX28 LRADC ADC" + depends on MFD_MXS_LRADC + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + help + Say yes here to build support for the ADC functions of the + i.MX23/i.MX28 LRADC. This includes general-purpose ADC readings, + battery voltage measurement, and die temperature measurement. + + This driver can also be built as a module. If so, the module will be + called mxs-lradc-adc. + config FSL_MX25_ADC tristate "Freescale MX25 ADC driver" depends on MFD_MX25_TSADC
drivers/iio/adc/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_MCP3422) += mcp3422.o obj-$(CONFIG_MEDIATEK_MT6577_AUXADC) += mt6577_auxadc.o obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o obj-$(CONFIG_MESON_SARADC) += meson_saradc.o +obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o obj-$(CONFIG_NAU7802) += nau7802.o obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
drivers/iio/adc/mxs-lradc-adc.c new file +843 -0
843 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v15 3/5 input: touchscreen: mxs-lradc: Add support for touchscreen
In reply to Ksenija StanojevicAdd 4-wire/5-wire touchscreen controller.
---
Changes in v15:
- use input_set_capability(input, EV_KEY, BTN_TOUCH) instead of __set_bit()s
- use return mxs_lradc_ts_register(ts) instead of return 0.
Changes in v14:
- none
Changes in v13:
- use struct state_info instead of using functions for doing conditionals on every operation.
- call mxs_lradc_ts_stop() before requesting interrupts.
Changes in v12:
- none
Changes in v11:
- use dev_get_drvdata instead dev_get_platdata
- use writel instead mxs_lradc_reg_* functions
Changes in v10:
- none
Changes in v9:
- none
Changes in v8:
- rebase onto 4.9-rc1
Changes in v7:
- remove touch_ret variable in probe and use ret instead
- make error check on of_property_read_u32 in probe
Changes in v6:
- update copyright
Changes in v5:
- add field void __iomem *base to struct mxs_lradc_adc
- change arguments in all functions for accessing I/O memory to follow the previous change.
- use devm_ioremap for mapping I/O memory
Changes in v4:
- update copyright
- use platform_get_irq_byname
- use irq_of_parse_and_map
Changes in v3:
- make buffer large enough for timestamps
- remove unnecessary blank lines
Changes in v2:
- improve commit message
- do not change spacing in Kconfig
- impove formating
- remove wrapper show_scale_avail
- use correct syntax for comments
- use devm_iio_trigger_alloc
- do not allocate buffer dynamically
- use iio_device_claim_*_mode helpers
- add spinlock in struct mxs_lradc_ts to enable locking in interrupt handler
- only grab irqs that are relevant to adc
- remove blank line at the end of the file
- change licence to GPL
- add copyright
drivers/input/touchscreen/Kconfig | 10 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/mxs-lradc-ts.c | 714 +++++++++++++++++++++++++++++++ 3 files changed, 725 insertions(+) create mode 100644 drivers/input/touchscreen/mxs-lradc-ts.c
drivers/input/touchscreen/Kconfig +10 -0
@@ -829,6 +829,16 @@ config TOUCHSCREEN_USB_COMPOSITE To compile this driver as a module, choose M here: the module will be called usbtouchscreen. +config TOUCHSCREEN_MXS_LRADC + tristate "Freescale i.MX23/i.MX28 LRADC touchscreen" + depends on MFD_MXS_LRADC + help + Say Y here if you have a touchscreen connected to the low-resolution + analog-to-digital converter (LRADC) on an i.MX23 or i.MX28 processor. + + To compile this driver as a module, choose M here: the module will be + called mxs-lradc-ts. + config TOUCHSCREEN_MX25 tristate "Freescale i.MX25 touchscreen input driver" depends on MFD_MX25_TSADC
drivers/input/touchscreen/Makefile +1 -0
@@ -45,6 +45,7 @@ obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o obj-$(CONFIG_TOUCHSCREEN_IPROC) += bcm_iproc_tsc.o obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o +obj-$(CONFIG_TOUCHSCREEN_MXS_LRADC) += mxs-lradc-ts.o obj-$(CONFIG_TOUCHSCREEN_MX25) += fsl-imx25-tcq.o obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o
drivers/input/touchscreen/mxs-lradc-ts.c new file +714 -0
714 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v15 4/5 iio: adc: mxs-lradc: Remove driver
In reply to Ksenija StanojevicSince the driver has been split into mfd there is no reason for it to stay, so remove it.
---
Changes in v15:
- none
Changes in v14:
- none
Changes in v13:
- none
Changes in v12:
- none
Changes in v11:
- none
Changes in v10:
- none
Changes in v9:
- none
Changes in v8:
- rebase onto 4.9-rc1
Changes in v7:
- none
Changes in v6:
- none
Changes in v5:
- none
Changes in v4:
- none
Changes in v3:
- none
Changes in v2:
- add to the patchset
drivers/iio/adc/Kconfig | 14 - drivers/iio/adc/Makefile | 1 - drivers/iio/adc/mxs-lradc.c | 1750 ------------------------------------------- 3 files changed, 1765 deletions(-) delete mode 100644 drivers/iio/adc/mxs-lradc.c
drivers/iio/adc/Kconfig +0 -14
@@ -436,20 +436,6 @@ config MESON_SARADC To compile this driver as a module, choose M here: the module will be called meson_saradc. -config MXS_LRADC - tristate "Freescale i.MX23/i.MX28 LRADC" - depends on (ARCH_MXS || COMPILE_TEST) && HAS_IOMEM - depends on INPUT - select STMP_DEVICE - select IIO_BUFFER - select IIO_TRIGGERED_BUFFER - help - Say yes here to build support for i.MX23/i.MX28 LRADC convertor - built into these chips. - - To compile this driver as a module, choose M here: the - module will be called mxs-lradc. - config NAU7802 tristate "Nuvoton NAU7802 ADC driver" depends on I2C
drivers/iio/adc/Makefile +0 -1
@@ -41,7 +41,6 @@ obj-$(CONFIG_MEDIATEK_MT6577_AUXADC) += mt6577_auxadc.o obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o obj-$(CONFIG_MESON_SARADC) += meson_saradc.o obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o -obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o obj-$(CONFIG_NAU7802) += nau7802.o obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
drivers/iio/adc/mxs-lradc.c deleted +0 -1750
1,750 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v15 5/5 mfd: Move binding document
In reply to Ksenija StanojevicThe bindings, which are now used in MFD, need also to be documented in the MFD binding document.
---
Changes in v15:
- none
Changes in v14:
- none
Changes in v13:
- none
Changes in v12:
- none
Changes in v11:
- none
Changes in v10:
- none
Changes in v9:
- format patch using -M option
Changes in v8:
- rebase onto 4.9-rc1
Changes in v7:
- add to the patchset
Documentation/devicetree/bindings/{iio/adc => mfd}/mxs-lradc.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename Documentation/devicetree/bindings/{iio/adc => mfd}/mxs-lradc.txt (100%)Documentation/devicetree/bindings/mfd/mxs-lradc.txt renamed from Documentation/devicetree/bindings/iio/adc/mxs-lradc.txt +0 -0
Signature · 1 line
1.9.1
Quoted 7 lines
Ksenija Stanojevic <[email protected]> hat am 16. März 2017 um 13:27 geschrieben:
Split existing driver mxs-lradc into MFD with touchscreen and IIO part.
Quoted 9 lines
Tested on I.MX28
Ksenija Stanojevic (5):
mfd: mxs-lradc: Add support for mxs-lradc MFD
iio: adc: mxs-lradc: Add support for adc driver
input: touchscreen: mxs-lradc: Add support for touchscreen
iio: adc: mxs-lradc: Remove driver
mfd: Move binding document
Please add my
for Patch 1 and 2 :)
Regarding to patch 5 i'm not sure. Shouldn't this go through the DT instead of the mfd tree? Unfortunately the DT maintainers aren't in CC and their ACKs are still missing.
Jonathan Cameron
maintainerQuoted 4 lines · Ksenija Stanojevic
Split existing driver mxs-lradc into MFD with touchscreen and IIO part.
Tested on I.MX28
Lee, I've been assuming you will take this one as an immutable branch in mfd, but let me know if you want it to go another route.
Jonathan
Quoted 28 lines
Ksenija Stanojevic (5):
mfd: mxs-lradc: Add support for mxs-lradc MFD
iio: adc: mxs-lradc: Add support for adc driver
input: touchscreen: mxs-lradc: Add support for touchscreen
iio: adc: mxs-lradc: Remove driver
mfd: Move binding document.../bindings/{iio/adc => mfd}/mxs-lradc.txt | 0 drivers/iio/adc/Kconfig | 27 +- drivers/iio/adc/Makefile | 2 +- drivers/iio/adc/mxs-lradc-adc.c | 843 ++++++++++ drivers/iio/adc/mxs-lradc.c | 1750 -------------------- drivers/input/touchscreen/Kconfig | 10 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/mxs-lradc-ts.c | 714 ++++++++ drivers/mfd/Kconfig | 17 + drivers/mfd/Makefile | 1 + drivers/mfd/mxs-lradc.c | 267 +++ include/linux/mfd/mxs-lradc.h | 187 +++ 12 files changed, 2054 insertions(+), 1765 deletions(-) rename Documentation/devicetree/bindings/{iio/adc => mfd}/mxs-lradc.txt (100%) create mode 100644 drivers/iio/adc/mxs-lradc-adc.c delete mode 100644 drivers/iio/adc/mxs-lradc.c create mode 100644 drivers/input/touchscreen/mxs-lradc-ts.c create mode 100644 drivers/mfd/mxs-lradc.c create mode 100644 include/linux/mfd/mxs-lradc.h
Quoted 7 lines · Jonathan Cameron
Quoted 4 lines · Ksenija Stanojevic
Split existing driver mxs-lradc into MFD with touchscreen and IIO part.
Tested on I.MX28
Lee, I've been assuming you will take this one as an immutable branch in mfd, but let me know if you want it to go another route.
Yes, I'll get around to it.
Quoted 28 lines
Quoted 27 lines
Ksenija Stanojevic (5):
mfd: mxs-lradc: Add support for mxs-lradc MFD
iio: adc: mxs-lradc: Add support for adc driver
input: touchscreen: mxs-lradc: Add support for touchscreen
iio: adc: mxs-lradc: Remove driver
mfd: Move binding document.../bindings/{iio/adc => mfd}/mxs-lradc.txt | 0 drivers/iio/adc/Kconfig | 27 +- drivers/iio/adc/Makefile | 2 +- drivers/iio/adc/mxs-lradc-adc.c | 843 ++++++++++ drivers/iio/adc/mxs-lradc.c | 1750 -------------------- drivers/input/touchscreen/Kconfig | 10 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/mxs-lradc-ts.c | 714 ++++++++ drivers/mfd/Kconfig | 17 + drivers/mfd/Makefile | 1 + drivers/mfd/mxs-lradc.c | 267 +++ include/linux/mfd/mxs-lradc.h | 187 +++ 12 files changed, 2054 insertions(+), 1765 deletions(-) rename Documentation/devicetree/bindings/{iio/adc => mfd}/mxs-lradc.txt (100%) create mode 100644 drivers/iio/adc/mxs-lradc-adc.c delete mode 100644 drivers/iio/adc/mxs-lradc.c create mode 100644 drivers/input/touchscreen/mxs-lradc-ts.c create mode 100644 drivers/mfd/mxs-lradc.c create mode 100644 include/linux/mfd/mxs-lradc.h
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
[GIT PULL] Immutable branch between MFD, IIO and Input due for the v4.12 merge window
In reply to Ksenija StanojevicEnjoy!
The following changes since commit c1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201:
Linux 4.11-rc1 (2017-03-05 12:59:56 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-iio-input-v4.12
for you to fetch changes up to b2d476404601806c5a94a5f9bfc441d3898a5541:
dt-bindings: mfd: Move mxs-lradc binding document from IIO to MFD (2017-03-23 12:29:29 +0000)
----------------------------------------------------------------
Immutable branch between MFD, IIO and Input due for the v4.12 merge window
----------------------------------------------------------------
Ksenija Stanojevic (5):
mfd: mxs-lradc: Add support for mxs-lradc
iio: adc: mxs-lradc: Add support for ADC driver
input: touchscreen: mxs-lradc: Add support for touchscreen
iio: adc: mxs-lradc: Remove driver
dt-bindings: mfd: Move mxs-lradc binding document from IIO to MFD
.../bindings/{iio/adc => mfd}/mxs-lradc.txt | 0
drivers/iio/adc/Kconfig | 27 +-
drivers/iio/adc/Makefile | 2 +-
drivers/iio/adc/mxs-lradc-adc.c | 843 ++++++++++
drivers/iio/adc/mxs-lradc.c | 1750 --------------------
drivers/input/touchscreen/Kconfig | 10 +
drivers/input/touchscreen/Makefile | 1 +
drivers/input/touchscreen/mxs-lradc-ts.c | 714 ++++++++
drivers/mfd/Kconfig | 17 +
drivers/mfd/Makefile | 1 +
drivers/mfd/mxs-lradc.c | 267 +++
include/linux/mfd/mxs-lradc.h | 187 +++
12 files changed, 2054 insertions(+), 1765 deletions(-)
rename Documentation/devicetree/bindings/{iio/adc => mfd}/mxs-lradc.txt (100%)
create mode 100644 drivers/iio/adc/mxs-lradc-adc.c
delete mode 100644 drivers/iio/adc/mxs-lradc.c
create mode 100644 drivers/input/touchscreen/mxs-lradc-ts.c
create mode 100644 drivers/mfd/mxs-lradc.c
create mode 100644 include/linux/mfd/mxs-lradc.hSignature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog