Skip to contentSkip to conversation

Add support for Broadcom iProc touchscreen

PATCH Superseded Jonathan Richardson 3 participants 8 messages Mar 21, 2015 – Mar 23, 2015

Subsystems (4)

v5 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v5 cover Add support for Broadcom iProc touchscreen

This patchset contains initial support for the touchscreen on the Broadcom iProc family of SoCs. This driver has been validated with Cygnus and is expected to work on other iProc family of SoCs that use the same touchscreen controller.

Changes from v4:
- Debug code cleanup.
- pdev wasn't initialized prior to calling get_tsc_config() in probe resulting in null dev pointer being passed to the function.

Changes from v3:
- Fixed typo in Kconfig.

Changes from v2:
- Misc style changes.
- Removed assumptions about interrupts generated in ISR. It now emits all events and then syncs if necessary.
- Removed our rotation property and replaced with the latest touchscreen-inverted-x/y. Also added support for the standard optional properties touchscreen-size-x/y and touchscreen-fuzz-x/y. Did not add support for inverted-x/y at this time as our touchscreen is currently only oriented 180 degres.

Changes from v1:
- Add missing newlines to debug messages
- Use BIT macro for defines
- Fix logic in get_tsc_config to improve readability
- Get rid of unnecessary remove() function

Jonathan Richardson (2):
Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver
Input: touchscreen-iproc: add device tree bindings

 .../input/touchscreen/brcm,iproc-touchscreen.txt   |   76 +++
 drivers/input/touchscreen/Kconfig                  |   11 +
 drivers/input/touchscreen/Makefile                 |    1 +
 drivers/input/touchscreen/bcm_iproc_tsc.c          |  518 ++++++++++++++++++++
 4 files changed, 606 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
 create mode 100644 drivers/input/touchscreen/bcm_iproc_tsc.c
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v5 1/2 Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

Add initial version of the Broadcom touchscreen driver.

---
 drivers/input/touchscreen/Kconfig         |   11 +
 drivers/input/touchscreen/Makefile        |    1 +
 drivers/input/touchscreen/bcm_iproc_tsc.c |  518 +++++++++++++++++++++++++++++
 3 files changed, 530 insertions(+)
 create mode 100644 drivers/input/touchscreen/bcm_iproc_tsc.c
drivers/input/touchscreen/Kconfig +11 -0
index 6261fd6..4a8b0e5 100644
@@ -323,6 +323,17 @@ config TOUCHSCREEN_ILI210X
 	  To compile this driver as a module, choose M here: the
 	  module will be called ili210x.
 
+config TOUCHSCREEN_IPROC
+	tristate "IPROC touch panel driver support"
+	help
+	  Say Y here if you want to add support for the IPROC touch
+	  controller to your system.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called bcm_iproc_tsc.
+
 config TOUCHSCREEN_S3C2410
 	tristate "Samsung S3C2410/generic touchscreen input driver"
 	depends on ARCH_S3C24XX || SAMSUNG_DEV_TS
drivers/input/touchscreen/Makefile +1 -0
index 0242fea..68f69bc 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_TOUCHSCREEN_GOODIX)	+= goodix.o
 obj-$(CONFIG_TOUCHSCREEN_ILI210X)	+= ili210x.o
 obj-$(CONFIG_TOUCHSCREEN_INEXIO)	+= inexio.o
 obj-$(CONFIG_TOUCHSCREEN_INTEL_MID)	+= intel-mid-touch.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_MC13783)	+= mc13783_ts.o
drivers/input/touchscreen/bcm_iproc_tsc.c new file +518 -0

518 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

Re: [PATCH v5 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

Hi Jonathan,

drivers/input/touchscreen/Kconfig config TOUCHSCREEN_ILI210X · line 327

Quoted 2 lines · Jonathan Richardson
drivers/input/touchscreen/Kconfig +2 -0
+config TOUCHSCREEN_IPROC
+	tristate "IPROC touch panel driver support"

I think this should depend on ARCH_BCM_IPROC || COMPILE_TEST, right?

(No need to resubmit).

Thanks.

Signature · 5 lines
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

Re: [PATCH v5 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

Quoted 9 lines · Dmitry Torokhov

Hi Jonathan,

drivers/input/touchscreen/Kconfig config TOUCHSCREEN_ILI210X · line 327

Quoted 2 lines · Jonathan Richardson
drivers/input/touchscreen/Kconfig +2 -0
+config TOUCHSCREEN_IPROC
+	tristate "IPROC touch panel driver support"

I think this should depend on ARCH_BCM_IPROC || COMPILE_TEST, right?

(No need to resubmit).

Hi Dmitry. That is correct - thanks.

Quoted 3 lines

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw

Re: [PATCH v5 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

Quoted 4 lines · Jonathan Richardson
Quoted 3 lines · Dmitry Torokhov

Hi Jonathan,

On Fri, Mar 20, 2015 at 05:57:25PM -0700, Jonathan Richardson wrote:

Quoted 8 lines
Quoted 6 lines

drivers/input/touchscreen/Kconfig config TOUCHSCREEN_ILI210X · line 327

Quoted 2 lines
drivers/input/touchscreen/Kconfig +2 -0
+config TOUCHSCREEN_IPROC
+	tristate "IPROC touch panel driver support"

I think this should depend on ARCH_BCM_IPROC || COMPILE_TEST, right?

(No need to resubmit).

Hi Dmitry. That is correct - thanks.

Excellent. Queued for 4.1.

Signature · 5 lines
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

Re: [PATCH v5 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

In reply to Jonathan Richardson

Hi Jonathan Richardson,

drivers/input/touchscreen/bcm_iproc_tsc.c line 507

Quoted 2 lines · Jonathan Richardson
drivers/input/touchscreen/bcm_iproc_tsc.c new file +2 -0
+static struct platform_driver iproc_ts_driver = {
+	.probe = iproc_ts_probe,

Just a little curious, is the .remove function missing or it doesn't need it.

Thanks.

drivers/input/touchscreen/bcm_iproc_tsc.c line 518

Quoted 11 lines
drivers/input/touchscreen/bcm_iproc_tsc.c new file +11 -0
+	.driver = {
+		.name	= IPROC_TS_NAME,
+		.of_match_table = of_match_ptr(iproc_ts_of_match),
+	},
+};
+
+module_platform_driver(iproc_ts_driver);
+
+MODULE_DESCRIPTION("IPROC Touchscreen driver");
+MODULE_AUTHOR("Broadcom");
+MODULE_LICENSE("GPL v2");

Best Regards,
Bo Shen

maintainer
#6 lore raw

Re: [PATCH v5 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver

Hi Bo,

Quoted 8 lines · Bo Shen

Hi Jonathan Richardson,

drivers/input/touchscreen/bcm_iproc_tsc.c line 507

Quoted 2 lines · Jonathan Richardson
drivers/input/touchscreen/bcm_iproc_tsc.c new file +2 -0
+static struct platform_driver iproc_ts_driver = {
+	.probe = iproc_ts_probe,

Just a little curious, is the .remove function missing or it doesn't need it.

When all resources used by a driver are managed (i.e. acquired via devm API) such driver does not need remove() method.

Thanks.

Signature · 1 line
Dmitry
#7 lore raw

PATCH v5 2/2 Input: touchscreen-iproc: add device tree bindings

In reply to Jonathan Richardson

Documents the touchscreen device tree binding for Broadcom iProc family of SoCs.

---
 .../input/touchscreen/brcm,iproc-touchscreen.txt   |   76 ++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt
Documentation/devicetree/bindings/input/touchscreen/brcm,iproc-touchscreen.txt new file +76 -0
new file mode 100644
index 0000000..34e3382
@@ -0,0 +1,76 @@
+* Broadcom's IPROC Touchscreen Controller
+
+Required properties:
+- compatible: must be "brcm,iproc-touchscreen"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- clocks:  The clock provided by the SOC to driver the tsc
+- clock-name:  name for the clock
+- interrupts: The touchscreen controller's interrupt
+
+Optional properties:
+- scanning_period: Time between scans. Each step is 1024 us.  Valid 1-256.
+- debounce_timeout: Each step is 512 us.  Valid 0-255
+- settling_timeout: The settling duration (in ms) is the amount of time
+                    the tsc waits to allow the voltage to settle after
+                    turning on the drivers in detection mode.
+                    Valid values: 0-11
+                    0 =  0.008 ms
+                    1 =  0.01 ms
+                    2 =  0.02 ms
+                    3 =  0.04 ms
+                    4 =  0.08 ms
+                    5 =  0.16 ms
+                    6 =  0.32 ms
+                    7 =  0.64 ms
+                    8 =  1.28 ms
+                    9 =  2.56 ms
+                   10 =  5.12 ms
+                   11 = 10.24 ms
+- touch_timeout: The continuous number of scan periods in which touch is
+                not detected before the controller returns to idle state.
+                Valid values 0-255.
+- average_data: Number of data samples which are averaged before a final
+                data point is placed into the FIFO
+                Valid values 0-7
+                0 =   1 sample
+                1 =   2 samples
+                2 =   4 samples
+                3 =   8 samples
+                4 =  16 samples
+                5 =  32 samples
+                6 =  64 samples
+                7 = 128 samples
+- fifo_threshold: Interrupt is generated whenever the number of fifo
+                entries exceeds this value
+                Valid values 0-31
+- touchscreen-size-x: horizontal resolution of touchscreen (in pixels)
+- touchscreen-size-y: vertical resolution of touchscreen (in pixels)
+- touchscreen-fuzz-x: horizontal noise value of the absolute input
+                      device (in pixels)
+- touchscreen-fuzz-y: vertical noise value of the absolute input
+                      device (in pixels)
+- touchscreen-inverted-x: X axis is inverted (boolean)
+- touchscreen-inverted-y: Y axis is inverted (boolean)
+
+Example:
+
+	touchscreen: tsc@0x180A6000 {
+		compatible = "brcm,iproc-touchscreen";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x180A6000 0x40>;
+		clocks = <&adc_clk>;
+		clock-names = "tsc_clk";
+		interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+
+		scanning_period = <5>;
+		debounce_timeout = <40>;
+		settling_timeout = <7>;
+		touch_timeout = <10>;
+		average_data = <5>;
+		fifo_threshold = <1>;
+		/* Touchscreen is rotated 180 degrees. */
+		touchscreen-inverted-x;
+		touchscreen-inverted-y;
+	};
Signature · 1 line
1.7.9.5