mc13892 touchscreen support
Subsystems (2)
Hi,
This patch series adds touchscreen support for the mc13892 to the mc13873 driver. The driver is renamed to mc13xxx_ts to reflect this.
The first 3 patches apply cleanly to v3.2.
The fourth patch allows setting the ATO and ATOX registers with each conversion. It requires another series I just posted [1].
Cheers,
Marc
[1] http://lists.arm.linux.org.uk/lurker/message/20120129.223322.722b7424.en.html
PATCH 1/4 input: mc13783_ts: rename to mc13xxx_ts
Start moving this driver towards support for both mc13892 and mc13783.
This patch simply renames mc13783 specific identifiers to the generic mc13xxx. A platform_device_id table is also added so that the driver is still created correctly for the mc13783 only.
--- drivers/input/touchscreen/Kconfig | 8 +- drivers/input/touchscreen/Makefile | 2 +- drivers/input/touchscreen/mc13783_ts.c | 259 ------------------------------- drivers/input/touchscreen/mc13xxx_ts.c | 267 ++++++++++++++++++++++++++++++++ 4 files changed, 272 insertions(+), 264 deletions(-) delete mode 100644 drivers/input/touchscreen/mc13783_ts.c create mode 100644 drivers/input/touchscreen/mc13xxx_ts.c
drivers/input/touchscreen/Kconfig +4 -4
@@ -548,9 +548,9 @@ config TOUCHSCREEN_USB_COMPOSITE To compile this driver as a module, choose M here: the module will be called usbtouchscreen. -config TOUCHSCREEN_MC13783 - tristate "Freescale MC13783 touchscreen input driver" - depends on MFD_MC13783 +config TOUCHSCREEN_MC13XXX + tristate "Freescale MC13xxx touchscreen input driver" + depends on MFD_MC13XXX help Say Y here if you have an Freescale MC13783 PMIC on your board and want to use its touchscreen
@@ -558,7 +558,7 @@ config TOUCHSCREEN_MC13783 If unsure, say N. To compile this driver as a module, choose M here: the - module will be called mc13783_ts. + module will be called mc13xxx_ts. config TOUCHSCREEN_USB_EGALAX default y
drivers/input/touchscreen/Makefile +1 -1
@@ -28,7 +28,7 @@ obj-$(CONFIG_TOUCHSCREEN_INEXIO) += inexio.o obj-$(CONFIG_TOUCHSCREEN_INTEL_MID) += intel-mid-touch.o obj-$(CONFIG_TOUCHSCREEN_LPC32XX) += lpc32xx_ts.o obj-$(CONFIG_TOUCHSCREEN_MAX11801) += max11801_ts.o -obj-$(CONFIG_TOUCHSCREEN_MC13783) += mc13783_ts.o +obj-$(CONFIG_TOUCHSCREEN_MC13XXX) += mc13xxx_ts.o obj-$(CONFIG_TOUCHSCREEN_MCS5000) += mcs5000_ts.o obj-$(CONFIG_TOUCHSCREEN_MIGOR) += migor_ts.o obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o
drivers/input/touchscreen/mc13783_ts.c deleted +0 -259
259 lines not on this page · raw message
drivers/input/touchscreen/mc13xxx_ts.c new file +267 -0
267 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH 1/4 input: mc13783_ts: rename to mc13xxx_ts
Hi Marc,
Quoted 7 lines · Marc Reilly
Start moving this driver towards support for both mc13892 and mc13783.
This patch simply renames mc13783 specific identifiers to the generic mc13xxx. A
platform_device_idtable is also added so that the driver is still created correctly for the mc13783 only.Signed-off-by Marc Reilly <[email protected]>
Quoted 8 lines
---
?drivers/input/touchscreen/Kconfig ? ? ?| ? ?8 +- ?drivers/input/touchscreen/Makefile ? ? | ? ?2 +- ?drivers/input/touchscreen/mc13783_ts.c | ?259 ------------------------------- ?drivers/input/touchscreen/mc13xxx_ts.c | ?267 ++++++++++++++++++++++++++++++++?4 files changed, 272 insertions(+), 264 deletions(-) ?delete mode 100644
drivers/input/touchscreen/mc13783_ts.c?create mode 100644drivers/input/touchscreen/mc13xxx_ts.c
For the rename, it is better to do:
git mv drivers/input/touchscreen/mc13783_ts.cdrivers/input/touchscreen/mc13xxx_ts.c
git commit -a
and then git format -M -1 , as it will detect the rename.
Regards,
Fabio Estevam
PATCH 1/4 input: mc13783_ts: rename to mc13xxx_ts
Hello,
Quoted 17 lines · Fabio Estevam
Quoted 7 lines · Marc Reilly
Start moving this driver towards support for both mc13892 and mc13783.
This patch simply renames mc13783 specific identifiers to the generic mc13xxx. A
platform_device_idtable is also added so that the driver is still created correctly for the mc13783 only.Signed-off-by Marc Reilly <[email protected]>Quoted 8 lines
---
?drivers/input/touchscreen/Kconfig ? ? ?| ? ?8 +- ?drivers/input/touchscreen/Makefile ? ? | ? ?2 +- ?drivers/input/touchscreen/mc13783_ts.c | ?259 ------------------------------- ?drivers/input/touchscreen/mc13xxx_ts.c | ?267 ++++++++++++++++++++++++++++++++?4 files changed, 272 insertions(+), 264 deletions(-) ?delete mode 100644
drivers/input/touchscreen/mc13783_ts.c?create mode 100644drivers/input/touchscreen/mc13xxx_ts.c
Quoted 7 lines
For the rename, it is better to do:
git mvdrivers/input/touchscreen/mc13783_ts.cdrivers/input/touchscreen/mc13xxx_ts.cgit commit -a
and then git format -M -1 , as it will detect the rename.
git format-patch -M will detect the rename independently of how the commit was created. Using git mv doesn't result in adding any special metadata to the commit, it's just mv $old $new; git rm $old; git add $new.
But +1 on using -M (or not renaming the driver).
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH 2/4 input: mc13xxx_ts: add support for mc13892
In reply to Marc ReillyThe way the raw touchscreen co-ordinates are sampled have some minor differences for the mc13892 and mc13873. This patch introduces an IC specific handler to convert the raw samples into x, y, pressure readings for the input sub-system.
The mc13892 ignores samples that have too high a contact resistance. Behaviour for the mc13873 is (intended to be) preserved.
Help text for the config item changes to reflect support for both IC types
--- drivers/input/touchscreen/Kconfig | 2 +- drivers/input/touchscreen/mc13xxx_ts.c | 132 +++++++++++++++++++++++++++----- 2 files changed, 115 insertions(+), 19 deletions(-)
drivers/input/touchscreen/Kconfig +1 -1
@@ -552,7 +552,7 @@ config TOUCHSCREEN_MC13XXX tristate "Freescale MC13xxx touchscreen input driver" depends on MFD_MC13XXX help - Say Y here if you have an Freescale MC13783 PMIC on your + Say Y here if you have an Freescale MC13xxx PMIC on your board and want to use its touchscreen If unsure, say N.
drivers/input/touchscreen/mc13xxx_ts.c +114 -18
209 lines not on this page · raw message
Signature · 1 line
1.7.3.4
PATCH 3/4 input: mc13xxx_ts: handle bad adc conversions
In reply to Marc ReillyBefore, if the adc conversion failed for some reason then no more samples would be taken until the after the next pen up/down interrupt.
--- drivers/input/touchscreen/mc13xxx_ts.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/input/touchscreen/mc13xxx_ts.c +5 -1
@@ -199,8 +199,12 @@ static void mc13xxx_ts_work(struct work_struct *work)unsigned int channel =12 ;if (mc13xxx_adc_do_conversion (priv->mc13xxx, - mode, channel, priv->sample) ==0 ) + mode, channel, priv->sample) ==0 ) {mc13xxx_ts_report_sample (priv); + }else { +dev_warn (&priv->idev->dev,"bad conversion" ); +queue_delayed_work (priv->workq, &priv->work,HZ /50 ); + } }static int mc13xxx_ts_open (struct input_dev *dev)
Signature · 1 line
1.7.3.4
PATCH 4/4 input: mc13xxx_ts: intersperse delays between ts samples
In reply to Marc ReillyThe mc13xxx ICs have the ability to add a small delay in between each sample taken in a set of TS samples. This allows time for the ts to be biased correctly, and improved accuracy of raw readings.
--- drivers/input/touchscreen/mc13xxx_ts.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/input/touchscreen/mc13xxx_ts.c +6 -2
@@ -197,9 +197,13 @@ static void mc13xxx_ts_work(struct work_struct *work) container_of(work, struct mc13xxx_ts_priv, work.work);unsigned int mode =MC13XXX_ADC_MODE_TS ;unsigned int channel =12 ; +u32 adc1_mask =MC13XXX_ADC1_ATOX |MC13XXX_ADC1_ATO_MASK ; +u32 adc1_val =MC13XXX_ADC1_ATOX | (3 <<MC13XXX_ADC1_ATO_SHIFT ); -if (mc13xxx_adc_do_conversion (priv->mc13xxx, - mode, channel, priv->sample) ==0 ) { +if (mc13xxx_adc_do_conversion_ex (priv->mc13xxx, + mode, channel, priv->sample, +0 ,0 , + adc1_mask, adc1_val) ==0 ) {mc13xxx_ts_report_sample (priv); }else {dev_warn (&priv->idev->dev,"bad conversion" );
Signature · 1 line
1.7.3.4