[PATCH] input: enable onkey driver of max8925

Haojian Zhuang haojian.zhuang at marvell.com
Mon Mar 8 11:28:43 EST 2010


Implement onkey driver. While ONKEY is held for 3 seconds, KEY_POWER
event occurs.

Signed-off-by: Haojian Zhuang <haojian.zhuang at marvell.com>
---
 drivers/input/misc/Kconfig         |   10 +++
 drivers/input/misc/Makefile        |    1 +
 drivers/input/misc/max8925_onkey.c |  148 ++++++++++++++++++++++++++++++++=
++++
 3 files changed, 159 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/misc/max8925_onkey.c

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 23140a3..5505b5c 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -50,6 +50,16 @@ config INPUT_M68K_BEEP
 	tristate "M68k Beeper support"
 	depends on M68K

+config INPUT_MAX8925_ONKEY
+	tristate "MAX8925 ONKEY support"
+	depends on MFD_MAX8925
+	help
+	  Support the ONKEY of MAX8925 PMICs as an input device
+	  reporting power button status.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called max8925_onkey.
+
 config INPUT_APANEL
 	tristate "Fujitsu Lifebook Application Panel buttons"
 	depends on X86 && I2C && LEDS_CLASS
diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
index 7e95a5d..71e9111 100644
--- a/drivers/input/misc/Makefile
+++ b/drivers/input/misc/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_HP_SDC_RTC)		+=3D hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)	+=3D ixp4xx-beeper.o
 obj-$(CONFIG_INPUT_KEYSPAN_REMOTE)	+=3D keyspan_remote.o
 obj-$(CONFIG_INPUT_M68K_BEEP)		+=3D m68kspkr.o
+obj-$(CONFIG_INPUT_MAX8925_ONKEY)	+=3D max8925_onkey.o
 obj-$(CONFIG_INPUT_PCAP)		+=3D pcap_keys.o
 obj-$(CONFIG_INPUT_PCF50633_PMU)	+=3D pcf50633-input.o
 obj-$(CONFIG_INPUT_PCSPKR)		+=3D pcspkr.o
diff --git a/drivers/input/misc/max8925_onkey.c
b/drivers/input/misc/max8925_onkey.c
new file mode 100644
index 0000000..0da2cff
--- /dev/null
+++ b/drivers/input/misc/max8925_onkey.c
@@ -0,0 +1,148 @@
+/**
+ * max8925_onkey.c - MAX8925 ONKEY driver
+ *
+ * Copyright (C) 2009 Marvell International Ltd.
+ *      Haojian Zhuang <haojian.zhuang at marvell.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file "COPYING" in the main directory of this
+ * archive for more details.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  U=
SA
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <linux/mfd/max8925.h>
+#include <linux/slab.h>
+
+#define HARDRESET_EN		(1 << 7)
+#define PWREN_EN		(1 << 7)
+
+struct max8925_onkey_info {
+	struct input_dev	*idev;
+	struct max8925_chip	*chip;
+	struct i2c_client	*i2c;
+	struct device		*dev;
+	int			irq;
+};
+
+/*
+ * MAX8925 gives us an interrupt when ONKEY is held for 3 seconds.
+ * max8925_set_bits() operates I2C bus and may sleep. So implement
+ * it in thread IRQ handler.
+ */
+static irqreturn_t max8925_onkey_handler(int irq, void *data)
+{
+	struct max8925_onkey_info *info =3D data;
+
+	input_report_key(info->idev, KEY_POWER, 1);
+	input_sync(info->idev);
+
+	/* Enable hardreset to halt if system isn't shutdown on time */
+	max8925_set_bits(info->i2c, MAX8925_SYSENSEL,
+			 HARDRESET_EN, HARDRESET_EN);
+	return IRQ_HANDLED;
+}
+
+static int __devinit max8925_onkey_probe(struct platform_device *pdev)
+{
+	struct max8925_chip *chip =3D dev_get_drvdata(pdev->dev.parent);
+	struct max8925_onkey_info *info;
+	int irq, ret;
+
+	info =3D kzalloc(sizeof(struct max8925_onkey_info), GFP_KERNEL);
+	if (!info)
+		return -ENOMEM;
+	info->chip =3D chip;
+	info->i2c =3D chip->i2c;
+	info->dev =3D &pdev->dev;
+	irq =3D chip->irq_base + MAX8925_IRQ_GPM_SW_3SEC;
+
+	info->idev =3D input_allocate_device();
+	if (!info->idev) {
+		dev_err(chip->dev, "Failed to allocate input dev\n");
+		ret =3D -ENOMEM;
+		goto out_input;
+	}
+
+	ret =3D request_threaded_irq(irq, NULL, max8925_onkey_handler,
+				   IRQF_ONESHOT, "onkey", info);
+	if (ret < 0) {
+		dev_err(chip->dev, "Failed to request IRQ: #%d: %d\n",
+			irq, ret);
+		goto out_irq;
+	}
+
+	info->idev->name =3D "max8925_on";
+	info->idev->phys =3D "max8925_on/input0";
+	info->idev->id.bustype =3D BUS_I2C;
+	info->idev->dev.parent =3D &pdev->dev;
+	info->irq =3D irq;
+	info->idev->evbit[0] =3D BIT_MASK(EV_KEY);
+	info->idev->keybit[BIT_WORD(KEY_POWER)] =3D BIT_MASK(KEY_POWER);
+
+	ret =3D input_register_device(info->idev);
+	if (ret) {
+		dev_err(chip->dev, "Can't register input device: %d\n", ret);
+		goto out;
+	}
+	platform_set_drvdata(pdev, info);
+
+	return 0;
+
+out:
+	free_irq(info->irq, info);
+out_irq:
+	input_free_device(info->idev);
+out_input:
+	kfree(info);
+	return ret;
+}
+
+static int __devexit max8925_onkey_remove(struct platform_device *pdev)
+{
+	struct max8925_onkey_info *info =3D platform_get_drvdata(pdev);
+
+	free_irq(info->irq, info);
+	input_unregister_device(info->idev);
+	kfree(info);
+	platform_set_drvdata(pdev, NULL);
+	return 0;
+}
+
+static struct platform_driver max8925_onkey_driver =3D {
+	.driver		=3D {
+		.name	=3D "max8925-onkey",
+		.owner	=3D THIS_MODULE,
+	},
+	.probe		=3D max8925_onkey_probe,
+	.remove		=3D __devexit_p(max8925_onkey_remove),
+};
+
+static int __init max8925_onkey_init(void)
+{
+	return platform_driver_register(&max8925_onkey_driver);
+}
+module_init(max8925_onkey_init);
+
+static void __exit max8925_onkey_exit(void)
+{
+	platform_driver_unregister(&max8925_onkey_driver);
+}
+module_exit(max8925_onkey_exit);
+
+MODULE_DESCRIPTION("Maxim MAX8925 ONKEY driver");
+MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang at marvell.com>");
+MODULE_LICENSE("GPL");
--=20
1.5.6.5

--001636e0a70fa0bfc90486fcbf3f
Content-Type: text/x-patch; charset=US-ASCII; 
	name="0003-input-enable-onkey-driver-of-max8925.patch"
Content-Disposition: attachment; 
	filename="0003-input-enable-onkey-driver-of-max8925.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g9ex4p9j0

RnJvbSAxN2MzN2YzZmQxNjExODNhM2ZhMjBiZmVmZjU4YWJkYzI4OWQzZmUyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBIYW9qaWFuIFpodWFuZyA8aGFvamlhbi56aHVhbmdAbWFydmVs
bC5jb20+CkRhdGU6IE1vbiwgOCBNYXIgMjAxMCAxMToyODo0MyAtMDUwMApTdWJqZWN0OiBbUEFU
Q0hdIGlucHV0OiBlbmFibGUgb25rZXkgZHJpdmVyIG9mIG1heDg5MjUKCkltcGxlbWVudCBvbmtl
eSBkcml2ZXIuIFdoaWxlIE9OS0VZIGlzIGhlbGQgZm9yIDMgc2Vjb25kcywgS0VZX1BPV0VSCmV2
ZW50IG9jY3Vycy4KClNpZ25lZC1vZmYtYnk6IEhhb2ppYW4gWmh1YW5nIDxoYW9qaWFuLnpodWFu
Z0BtYXJ2ZWxsLmNvbT4KLS0tCiBkcml2ZXJzL2lucHV0L21pc2MvS2NvbmZpZyAgICAgICAgIHwg
ICAxMCArKysKIGRyaXZlcnMvaW5wdX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PTktFWSBkcml2ZXIiKTsKK01PRFVMRV9BVVRI
T1IoIkhhb2ppYW4gWmh1YW5nIDxoYW9qaWFuLnpodWFuZ0BtYXJ2ZWxsLmNvbT4iKTsKK01PRFVM
RV9MSUNFTlNFKCJHUEwiKTsKLS0gCjEuNS42LjUKCg==
--001636e0a70fa0bfc90486fcbf3f--



More information about the linux-arm-kernel mailing list