[PATCH] input: enable touch on 88pm860x
Haojian Zhuang
haojian.zhuang at marvell.com
Thu Nov 12 12:15:51 EST 2009
Signed-off-by: Haojian Zhuang <haojian.zhuang at marvell.com>
---
drivers/input/touchscreen/88pm860x-ts.c | 239 +++++++++++++++++++++++++++=
++++
drivers/input/touchscreen/Kconfig | 7 +
drivers/input/touchscreen/Makefile | 1 +
include/linux/mfd/88pm860x.h | 1 +
4 files changed, 248 insertions(+), 0 deletions(-)
create mode 100644 drivers/input/touchscreen/88pm860x-ts.c
diff --git a/drivers/input/touchscreen/88pm860x-ts.c
b/drivers/input/touchscreen/88pm860x-ts.c
new file mode 100644
index 0000000..8a6a27a
--- /dev/null
+++ b/drivers/input/touchscreen/88pm860x-ts.c
@@ -0,0 +1,239 @@
+/*
+ * Touchscreen driver for Marvell 88PM860x
+ *
+ * Copyright (C) 2009 Marvell International Ltd.
+ * Haojian Zhuang <haojian.zhuang at marvell.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/mfd/88pm860x.h>
+
+#define MEAS_LEN (8)
+#define ACCURATE_BIT (12)
+
+/* touch register */
+#define MEAS_EN3 (0x52)
+
+#define MEAS_TSIX_1 (0x8D)
+#define MEAS_TSIX_2 (0x8E)
+#define MEAS_TSIY_1 (0x8F)
+#define MEAS_TSIY_2 (0x90)
+#define MEAS_TSIZ1_1 (0x91)
+#define MEAS_TSIZ1_2 (0x92)
+#define MEAS_TSIZ2_1 (0x93)
+#define MEAS_TSIZ2_2 (0x94)
+
+/* bit definitions of touch */
+#define MEAS_PD_EN (1 << 3)
+#define MEAS_TSIX_EN (1 << 4)
+#define MEAS_TSIY_EN (1 << 5)
+#define MEAS_TSIZ1_EN (1 << 6)
+#define MEAS_TSIZ2_EN (1 << 7)
+
+struct pm860x_touch {
+ struct input_dev *idev;
+ struct pm860x_chip *chip;
+ int irq;
+ int res_x; /* resistor of Xplate */
+};
+
+static irqreturn_t pm860x_touch_handler(int irq, void *data)
+{
+ struct pm860x_touch *touch =3D data;
+ struct pm860x_chip *chip =3D touch->chip;
+ unsigned char buf[MEAS_LEN];
+ int x, y, pen_down;
+ int z1, z2, rt =3D 0;
+ int ret;
+
+ pm860x_mask_irq(chip, irq);
+ ret =3D pm860x_bulk_read(chip->parent, DESC_8607, MEAS_TSIX_1,
+ MEAS_LEN, buf);
+ if (ret < 0)
+ goto out;
+
+ pen_down =3D buf[1] & (1 << 6);
+ x =3D ((buf[0] & 0xFF) << 4) | (buf[1] & 0x0F);
+ y =3D ((buf[2] & 0xFF) << 4) | (buf[3] & 0x0F);
+ z1 =3D ((buf[4] & 0xFF) << 4) | (buf[5] & 0x0F);
+ z2 =3D ((buf[6] & 0xFF) << 4) | (buf[7] & 0x0F);
+
+ if (pen_down) {
+ if ((x !=3D 0) && (z1 !=3D 0) && (touch->res_x !=3D 0)) {
+ rt =3D z2 / z1 - 1;
+ rt =3D (rt * touch->res_x * x) >> ACCURATE_BIT;
+ dev_dbg(chip->dev, "z1:%d, z2:%d, rt:%d\n",
+ z1, z2, rt);
+ }
+ input_report_abs(touch->idev, ABS_X, x);
+ input_report_abs(touch->idev, ABS_Y, y);
+ input_report_abs(touch->idev, ABS_PRESSURE, rt);
+ input_report_key(touch->idev, BTN_TOUCH, 1);
+ } else {
+ input_report_abs(touch->idev, ABS_PRESSURE, 0);
+ input_report_key(touch->idev, BTN_TOUCH, 0);
+ }
+ input_sync(touch->idev);
+ pm860x_unmask_irq(chip, irq);
+
+ if (pen_down)
+ dev_dbg(chip->dev, "pen down at [%d, %d].\n", x, y);
+ else
+ dev_dbg(chip->dev, "pen release\n");
+out:
+ return IRQ_HANDLED;
+}
+
+static int pm860x_touch_open(struct input_dev *dev)
+{
+ struct pm860x_touch *touch =3D input_get_drvdata(dev);
+ struct pm860x_chip *chip =3D touch->chip;
+ int data, ret;
+
+ data =3D MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
+ | MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
+ ret =3D pm860x_set_bits(chip->parent, DESC_8607, MEAS_EN3,
+ data, data);
+ if (ret < 0)
+ goto out;
+ pm860x_unmask_irq(chip, touch->irq);
+ return 0;
+out:
+ return ret;
+}
+
+static void pm860x_touch_close(struct input_dev *dev)
+{
+ struct pm860x_touch *touch =3D input_get_drvdata(dev);
+ struct pm860x_chip *chip =3D touch->chip;
+ int data;
+
+ data =3D MEAS_PD_EN | MEAS_TSIX_EN | MEAS_TSIY_EN
+ | MEAS_TSIZ1_EN | MEAS_TSIZ2_EN;
+ pm860x_set_bits(chip->parent, DESC_8607, MEAS_EN3,
+ data, 0);
+ pm860x_mask_irq(chip, touch->irq);
+}
+
+static int __devinit pm860x_touch_probe(struct platform_device *pdev)
+{
+ struct pm860x_chip *chip =3D dev_get_drvdata(pdev->dev.parent);
+ struct pm860x_plat_data *pm860x_pdata;
+ struct pm860x_touch_pdata *pdata;
+ struct pm860x_touch *touch;
+ int irq, ret;
+
+ irq =3D platform_get_irq(pdev, 0);
+ if (irq < 0) {
+ dev_err(&pdev->dev, "No IRQ resource!\n");
+ return -EINVAL;
+ }
+
+ if (pdev->dev.parent->platform_data) {
+ pm860x_pdata =3D pdev->dev.parent->platform_data;
+ pdata =3D pm860x_pdata->touch;
+ } else
+ pdata =3D NULL;
+
+ if (pdata =3D=3D NULL) {
+ dev_err(&pdev->dev, "platform data isn't assigned to "
+ "touch\n");
+ return -EINVAL;
+ }
+
+ touch =3D kzalloc(sizeof(struct pm860x_touch), GFP_KERNEL);
+ if (touch =3D=3D NULL)
+ return -ENOMEM;
+ dev_set_drvdata(&pdev->dev, touch);
+
+ touch->idev =3D input_allocate_device();
+ if (touch->idev =3D=3D NULL) {
+ dev_err(&pdev->dev, "Failed to allocate input device!\n");
+ ret =3D -ENOMEM;
+ goto out;
+ }
+
+ touch->idev->name =3D "88pm860x-touch";
+ touch->idev->phys =3D "88pm860x/input0";
+ touch->idev->id.bustype =3D BUS_I2C;
+ touch->idev->dev.parent =3D &pdev->dev;
+ touch->idev->open =3D pm860x_touch_open;
+ touch->idev->close =3D pm860x_touch_close;
+ touch->chip =3D chip;
+ touch->irq =3D irq;
+ touch->res_x =3D pdata->res_x;
+ input_set_drvdata(touch->idev, touch);
+
+ ret =3D pm860x_request_irq(chip, irq, pm860x_touch_handler, touch);
+ if (ret < 0)
+ goto out_irq;
+
+ __set_bit(EV_ABS, touch->idev->evbit);
+ __set_bit(ABS_X, touch->idev->absbit);
+ __set_bit(ABS_Y, touch->idev->absbit);
+ __set_bit(ABS_PRESSURE, touch->idev->absbit);
+ __set_bit(EV_SYN, touch->idev->evbit);
+ __set_bit(EV_KEY, touch->idev->evbit);
+ __set_bit(BTN_TOUCH, touch->idev->keybit);
+
+ input_set_abs_params(touch->idev, ABS_X, 0, 1 << ACCURATE_BIT, 0, 0);
+ input_set_abs_params(touch->idev, ABS_Y, 0, 1 << ACCURATE_BIT, 0, 0);
+ input_set_abs_params(touch->idev, ABS_PRESSURE, 0, 1 << ACCURATE_BIT,
+ 0, 0);
+
+ ret =3D input_register_device(touch->idev);
+ if (ret < 0) {
+ dev_err(chip->dev, "Failed to register touch!\n");
+ goto out_rg;
+ }
+
+ platform_set_drvdata(pdev, touch);
+ return 0;
+out_rg:
+ pm860x_free_irq(chip, irq);
+out_irq:
+ input_free_device(touch->idev);
+out:
+ kfree(touch);
+ return ret;
+}
+
+static int __devexit pm860x_touch_remove(struct platform_device *pdev)
+{
+ struct pm860x_touch *touch =3D platform_get_drvdata(pdev);
+
+ input_unregister_device(touch->idev);
+ return 0;
+}
+
+static struct platform_driver pm860x_touch_driver =3D {
+ .driver =3D {
+ .name =3D "88pm860x-touch",
+ .owner =3D THIS_MODULE,
+ },
+ .probe =3D pm860x_touch_probe,
+ .remove =3D __devexit_p(pm860x_touch_remove),
+};
+
+static int __init pm860x_touch_init(void)
+{
+ return platform_driver_register(&pm860x_touch_driver);
+}
+module_init(pm860x_touch_init);
+
+static void __exit pm860x_touch_exit(void)
+{
+ platform_driver_unregister(&pm860x_touch_driver);
+}
+module_exit(pm860x_touch_exit);
+
+MODULE_DESCRIPTION("Touchscreen driver for Marvell Semiconductor 88PM860x"=
);
+MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang at marvell.com>");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:88pm860x-touch");
diff --git a/drivers/input/touchscreen/Kconfig
b/drivers/input/touchscreen/Kconfig
index 8cc453c..0b06a53 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -530,4 +530,11 @@ config TOUCHSCREEN_PCAP
To compile this driver as a module, choose M here: the
module will be called pcap_ts.
+
+config TOUCHSCREEN_88PM860X
+ bool "Marvell 88PM860x touchscreen"
+ depends on MFD_88PM860X
+ help
+ Say Y here if you have a 88PM860x PMIC and want to enable
+ support for the built-in touchscreen.
endif
diff --git a/drivers/input/touchscreen/Makefile
b/drivers/input/touchscreen/Makefile
index 15fa62c..b278a1f 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -6,6 +6,7 @@
wm97xx-ts-y :=3D wm97xx-core.o
+obj-$(CONFIG_TOUCHSCREEN_88PM860X) +=3D 88pm860x-ts.o
obj-$(CONFIG_TOUCHSCREEN_AD7877) +=3D ad7877.o
obj-$(CONFIG_TOUCHSCREEN_AD7879) +=3D ad7879.o
obj-$(CONFIG_TOUCHSCREEN_ADS7846) +=3D ads7846.o
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index b7f9aac..fc31bad 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -347,6 +347,7 @@ struct pm860x_touch_pdata {
int tsi_prebias; /* time, slot */
int pen_prebias; /* time, slot */
int pen_prechg; /* time, slot */
+ int res_x; /* resistor of Xplate */
unsigned long flags;
};
--=20
1.5.6.5
--00151773da303ba12204788b39cc
Content-Type: text/x-patch; charset=US-ASCII;
name="0009-input-enable-touch-on-88pm860x.patch"
Content-Disposition: attachment;
filename="0009-input-enable-touch-on-88pm860x.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g24qtw8p0
RnJvbSA4ZTY2NjMwYjBkNmExNmZjOWFmN2MzODQ3MmVkYTE2NjIyNTg4NGUzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBIYW9qaWFuIFpodWFuZyA8aGFvamlhbi56aHVhbmdAbWFydmVs
bC5jb20+CkRhdGU6IFRodSwgMTIgTm92IDIwMDkgMTI6MTU6NTEgLTA1MDAKU3ViamVjdDogW1BB
VENIXSBpbnB1dDogZW5hYmxlIHRvdWNoIG9uIDg4cG04NjB4CgpTaWduZWQtb2ZmLWJ5OiBIYW9q
aWFuIFpodWFuZyA8aGFvamlhbi56aHVhbmdAbWFydmVsbC5jb20+Ci0tLQogZHJpdmVycy9pbnB1
dC90b3VjaHNjcmVlbi84OHBtODYweC10cy5jIHwgIDIzOSArKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysrCiBkcml2ZXJzL2lucHV0L3RvdWNoc2NyZWVuL0tjb25maWcgICAgICAgfCAgICA3
ICsKIGRyaXZlcnMvaW5wdXQvdG91Y2hzY3JlZW4vTWFrZWZpbGUgICAgICB8ICAgIDEgKwogaW5j
bHVkZS9saW51eC9tZmQvODhwbTg2MHguaCAgICAgICAgICAgIHwgICAgMSArCiA0IGZpbGVzIGNo
YW5nZWQsIDI0OCBpbnNlcnRpb25zKCspLCAwIGRlbGV0aW9ucygtKQogY3JlYXRlIG1vZGUgMTAw
NjQ0IGRyaXZlcnMvaW5wdXQvdG91Y2hzY3JlZW4vODhwbTg2MHgtdHMuYwoKZGlmZiAtLWdpdCBh
L2RyaXZlcnMvaW5wdXQvdG91Y2hzY3JlZW4vODhwbTg2MHgtdHMuYyBiL2RyaXZlcnMvaW5w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788b39cc--
More information about the linux-arm-kernel
mailing list