Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1494570 > unrolled thread
| Started by | Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
|---|---|
| First post | 2016-10-02 16:20 +0200 |
| Last post | 2016-10-02 16:20 +0200 |
| Articles | 4 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH v7 0/5] mxs-lradc: Split driver into MFD Ksenija Stanojevic <ksenija.stanojevic@gmail.com> - 2016-10-02 16:20 +0200
[PATCH v7 2/5] iio: adc: mxs-lradc: Add support for adc driver Ksenija Stanojevic <ksenija.stanojevic@gmail.com> - 2016-10-02 16:20 +0200
[PATCH v7 5/5] mfd: Move binding document Ksenija Stanojevic <ksenija.stanojevic@gmail.com> - 2016-10-02 16:20 +0200
[PATCH v7 1/5] mfd: mxs-lradc: Add support for mxs-lradc MFD Ksenija Stanojevic <ksenija.stanojevic@gmail.com> - 2016-10-02 16:20 +0200
| From | Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
|---|---|
| Date | 2016-10-02 16:20 +0200 |
| Subject | [PATCH v7 0/5] mxs-lradc: Split driver into MFD |
| Message-ID | <snPMt-7Xb-3@gated-at.bofh.it> |
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 .../devicetree/bindings/iio/adc/mxs-lradc.txt | 47 - .../devicetree/bindings/mfd/mxs-lradc.txt | 47 + drivers/iio/adc/Kconfig | 27 +- drivers/iio/adc/Makefile | 2 +- drivers/iio/adc/mxs-lradc.c | 1750 -------------------- drivers/input/touchscreen/Kconfig | 10 + drivers/input/touchscreen/Makefile | 1 + drivers/mfd/Kconfig | 17 + drivers/mfd/Makefile | 1 + 9 files changed, 90 insertions(+), 1812 deletions(-) delete mode 100644 Documentation/devicetree/bindings/iio/adc/mxs-lradc.txt create mode 100644 Documentation/devicetree/bindings/mfd/mxs-lradc.txt delete mode 100644 drivers/iio/adc/mxs-lradc.c -- 1.9.1
[toc] | [next] | [standalone]
| From | Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
|---|---|
| Date | 2016-10-02 16:20 +0200 |
| Subject | [PATCH v7 2/5] iio: adc: mxs-lradc: Add support for adc driver |
| Message-ID | <snPMt-7Xb-7@gated-at.bofh.it> |
| In reply to | #1494570 |
Add support for sixteen-channel 12-bit resolution ADC and its functions, which include general-purpose ADC readings, battery voltage measurement, and die temperature measurement. Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com> Reviewed-by: Jonathan Cameron <jic23@kernel.org> --- 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 + 2 files changed, 14 insertions(+) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 7edcf32..6414397 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -207,6 +207,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 diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index 7a40c04..e62ebeb 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -34,6 +34,7 @@ obj-$(CONFIG_MCP320X) += mcp320x.o obj-$(CONFIG_MCP3422) += mcp3422.o obj-$(CONFIG_MEDIATEK_MT6577_AUXADC) += mt6577_auxadc.o obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.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 -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
|---|---|
| Date | 2016-10-02 16:20 +0200 |
| Subject | [PATCH v7 5/5] mfd: Move binding document |
| Message-ID | <snPMu-7Xb-13@gated-at.bofh.it> |
| In reply to | #1494570 |
The bindings, which are now used in MFD, need also to be
documented in the MFD binding document.
Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
---
Changes in v7:
- add to the patchset
.../devicetree/bindings/iio/adc/mxs-lradc.txt | 47 ----------------------
.../devicetree/bindings/mfd/mxs-lradc.txt | 47 ++++++++++++++++++++++
2 files changed, 47 insertions(+), 47 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/iio/adc/mxs-lradc.txt
create mode 100644 Documentation/devicetree/bindings/mfd/mxs-lradc.txt
diff --git a/Documentation/devicetree/bindings/iio/adc/mxs-lradc.txt b/Documentation/devicetree/bindings/iio/adc/mxs-lradc.txt
deleted file mode 100644
index 555fb11..0000000
--- a/Documentation/devicetree/bindings/iio/adc/mxs-lradc.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-* Freescale MXS LRADC device driver
-
-Required properties:
-- compatible: Should be "fsl,imx23-lradc" for i.MX23 SoC and "fsl,imx28-lradc"
- for i.MX28 SoC
-- reg: Address and length of the register set for the device
-- interrupts: Should contain the LRADC interrupts
-
-Optional properties:
-- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
- to LRADC. Valid value is either 4 or 5. If this
- property is not present, then the touchscreen is
- disabled. 5 wires is valid for i.MX28 SoC only.
-- fsl,ave-ctrl: number of samples per direction to calculate an average value.
- Allowed value is 1 ... 32, default is 4
-- fsl,ave-delay: delay between consecutive samples. Allowed value is
- 2 ... 2048. It is used if 'fsl,ave-ctrl' > 1, counts at
- 2 kHz and its default is 2 (= 1 ms)
-- fsl,settling: delay between plate switch to next sample. Allowed value is
- 1 ... 2047. It counts at 2 kHz and its default is
- 10 (= 5 ms)
-
-Example for i.MX23 SoC:
-
- lradc@80050000 {
- compatible = "fsl,imx23-lradc";
- reg = <0x80050000 0x2000>;
- interrupts = <36 37 38 39 40 41 42 43 44>;
- status = "okay";
- fsl,lradc-touchscreen-wires = <4>;
- fsl,ave-ctrl = <4>;
- fsl,ave-delay = <2>;
- fsl,settling = <10>;
- };
-
-Example for i.MX28 SoC:
-
- lradc@80050000 {
- compatible = "fsl,imx28-lradc";
- reg = <0x80050000 0x2000>;
- interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;
- status = "okay";
- fsl,lradc-touchscreen-wires = <5>;
- fsl,ave-ctrl = <4>;
- fsl,ave-delay = <2>;
- fsl,settling = <10>;
- };
diff --git a/Documentation/devicetree/bindings/mfd/mxs-lradc.txt b/Documentation/devicetree/bindings/mfd/mxs-lradc.txt
new file mode 100644
index 0000000..555fb11
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/mxs-lradc.txt
@@ -0,0 +1,47 @@
+* Freescale MXS LRADC device driver
+
+Required properties:
+- compatible: Should be "fsl,imx23-lradc" for i.MX23 SoC and "fsl,imx28-lradc"
+ for i.MX28 SoC
+- reg: Address and length of the register set for the device
+- interrupts: Should contain the LRADC interrupts
+
+Optional properties:
+- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
+ to LRADC. Valid value is either 4 or 5. If this
+ property is not present, then the touchscreen is
+ disabled. 5 wires is valid for i.MX28 SoC only.
+- fsl,ave-ctrl: number of samples per direction to calculate an average value.
+ Allowed value is 1 ... 32, default is 4
+- fsl,ave-delay: delay between consecutive samples. Allowed value is
+ 2 ... 2048. It is used if 'fsl,ave-ctrl' > 1, counts at
+ 2 kHz and its default is 2 (= 1 ms)
+- fsl,settling: delay between plate switch to next sample. Allowed value is
+ 1 ... 2047. It counts at 2 kHz and its default is
+ 10 (= 5 ms)
+
+Example for i.MX23 SoC:
+
+ lradc@80050000 {
+ compatible = "fsl,imx23-lradc";
+ reg = <0x80050000 0x2000>;
+ interrupts = <36 37 38 39 40 41 42 43 44>;
+ status = "okay";
+ fsl,lradc-touchscreen-wires = <4>;
+ fsl,ave-ctrl = <4>;
+ fsl,ave-delay = <2>;
+ fsl,settling = <10>;
+ };
+
+Example for i.MX28 SoC:
+
+ lradc@80050000 {
+ compatible = "fsl,imx28-lradc";
+ reg = <0x80050000 0x2000>;
+ interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;
+ status = "okay";
+ fsl,lradc-touchscreen-wires = <5>;
+ fsl,ave-ctrl = <4>;
+ fsl,ave-delay = <2>;
+ fsl,settling = <10>;
+ };
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
|---|---|
| Date | 2016-10-02 16:20 +0200 |
| Subject | [PATCH v7 1/5] mfd: mxs-lradc: Add support for mxs-lradc MFD |
| Message-ID | <snPMt-7Xb-11@gated-at.bofh.it> |
| In reply to | #1494570 |
Add core files for mxs-lradc MFD driver.
Note: this patch won't compile in iio/testing without this patch:
a8f447be8056 ("mfd: Add resource managed APIs for mfd_add_devices")
Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
---
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 +
2 files changed, 18 insertions(+)
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 2d1fb64..188c7d1 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -308,6 +308,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
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 2ba3ba3..c9f9c80 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -207,3 +207,4 @@ obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
obj-$(CONFIG_MFD_MT6397) += mt6397-core.o
obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o
+obj-$(CONFIG_MFD_MXS_LRADC) += mxs-lradc.o
--
1.9.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web