Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1496456

[PATCH V1 03/10] Input: da9061: onkey driver

From Steve Twiss <stwiss.opensource@diasemi.com>
Newsgroups linux.kernel
Subject [PATCH V1 03/10] Input: da9061: onkey driver
Date 2016-10-06 11:20 +0200
Message-ID <spd0m-6Av-15@gated-at.bofh.it> (permalink)
References <spcQG-6wB-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Steve Twiss <stwiss.opensource@diasemi.com>

Support for the DA9061 onkey is added into the DA9063 onkey driver.

The of_device_id match array is expanded to support "dlg,da9061-onkey" as a
valid .compatible string. A new chip configuration register map listed in
da9061_regs is added and linked to this device tree compatible string in
the .data section.

Copyright header is updated to add DA9061 in its description and the module
description macro is extended to include DA9061.

Kconfig is updated to reflect support for DA9061/62/63.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>

---
This patch applies against linux-next and v4.8

Dmitry,

The DA9063 onkey driver is modified to support the DA9061 onkey.
Because of earlier work with DA9062 it is a simple matter to extend this
for DA9061 by adding a new compatible string and register mapping.
  { .compatible = "dlg,da9061-onkey", .data = &da9061_regs },

Regards,
Steve Twiss, Dialog Semiconductor Ltd.


 drivers/input/misc/Kconfig        |  7 ++++---
 drivers/input/misc/da9063_onkey.c | 24 ++++++++++++++++++++----
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index efb0ca8..57cc9c2 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -613,11 +613,12 @@ config INPUT_DA9055_ONKEY
 	  will be called da9055_onkey.
 
 config INPUT_DA9063_ONKEY
-	tristate "Dialog DA9062/63 OnKey"
+	tristate "Dialog DA9063/62/61 OnKey"
 	depends on MFD_DA9063 || MFD_DA9062
 	help
-	  Support the ONKEY of Dialog DA9063 and DA9062 Power Management ICs
-	  as an input device capable of reporting the power button status.
+	  Support the ONKEY of Dialog DA9063, DA9062 and DA9061 Power
+	  Management ICs as an input device capable of reporting the
+	  power button status.
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called da9063_onkey.
diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c
index bb863e0..60c29cd 100644
--- a/drivers/input/misc/da9063_onkey.c
+++ b/drivers/input/misc/da9063_onkey.c
@@ -1,5 +1,5 @@
 /*
- * OnKey device driver for DA9063 and DA9062 PMICs
+ * OnKey device driver for DA9063, DA9062 and DA9061 PMICs
  * Copyright (C) 2015  Dialog Semiconductor Ltd.
  *
  * This program is free software; you can redistribute it and/or
@@ -82,9 +82,25 @@ static const struct da906x_chip_config da9062_regs = {
 	.name = "da9062-onkey",
 };
 
+static const struct da906x_chip_config da9061_regs = {
+	/* REGS */
+	.onkey_status = DA9062AA_STATUS_A,
+	.onkey_pwr_signalling = DA9062AA_CONTROL_B,
+	.onkey_fault_log = DA9062AA_FAULT_LOG,
+	.onkey_shutdown = DA9062AA_CONTROL_F,
+	/* MASKS */
+	.onkey_nonkey_mask = DA9062AA_NONKEY_MASK,
+	.onkey_nonkey_lock_mask = DA9062AA_NONKEY_LOCK_MASK,
+	.onkey_key_reset_mask = DA9062AA_KEY_RESET_MASK,
+	.onkey_shutdown_mask = DA9062AA_SHUTDOWN_MASK,
+	/* NAMES */
+	.name = "da9061-onkey",
+};
+
 static const struct of_device_id da9063_compatible_reg_id_table[] = {
 	{ .compatible = "dlg,da9063-onkey", .data = &da9063_regs },
 	{ .compatible = "dlg,da9062-onkey", .data = &da9062_regs },
+	{ .compatible = "dlg,da9061-onkey", .data = &da9061_regs },
 	{ },
 };
 
@@ -149,13 +165,13 @@ static void da9063_poll_on(struct work_struct *work)
 			 * and then send shutdown command
 			 */
 			dev_dbg(&onkey->input->dev,
-				"Sending SHUTDOWN to DA9063 ...\n");
+				"Sending SHUTDOWN to PMIC ...\n");
 			error = regmap_write(onkey->regmap,
 					     config->onkey_shutdown,
 					     config->onkey_shutdown_mask);
 			if (error)
 				dev_err(&onkey->input->dev,
-					"Cannot SHUTDOWN DA9063: %d\n",
+					"Cannot SHUTDOWN PMIC: %d\n",
 					error);
 		}
 	}
@@ -300,6 +316,6 @@ static struct platform_driver da9063_onkey_driver = {
 module_platform_driver(da9063_onkey_driver);
 
 MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>");
-MODULE_DESCRIPTION("Onkey device driver for Dialog DA9063 and DA9062");
+MODULE_DESCRIPTION("Onkey device driver for Dialog DA9063, DA9062 and DA9061");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:" DA9063_DRVNAME_ONKEY);
-- 
end-of-patch for PATCH V1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V1 00/10]  da9061: DA9061 driver submission Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
  [PATCH V1 06/10] Documentation: dt: input: temperature driver Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
    Re: [PATCH V1 06/10] Documentation: dt: input: temperature driver Rob Herring <robh@kernel.org> - 2016-10-10 15:40 +0200
      RE: [PATCH V1 06/10] Documentation: dt: input: temperature driver Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-11 14:00 +0200
  [PATCH V1 04/10] watchdog: da9061: watchdog driver Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
    Re: [PATCH V1 04/10] watchdog: da9061: watchdog driver Guenter Roeck <linux@roeck-us.net> - 2016-10-06 15:30 +0200
  [PATCH V1 03/10] Input: da9061: onkey driver Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
  [PATCH V1 01/10] mfd: da9061: MFD core support Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
    Re: [PATCH V1 01/10] mfd: da9061: MFD core support Keerthy <a0393675@ti.com> - 2016-10-06 12:40 +0200
      RE: [PATCH V1 01/10] mfd: da9061: MFD core support Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 18:40 +0200
      RE: [PATCH V1 01/10] mfd: da9061: MFD core support Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-07 16:40 +0200
        Re: [PATCH V1 01/10] mfd: da9061: MFD core support Keerthy <a0393675@ti.com> - 2016-10-08 05:00 +0200
  [PATCH V1 02/10] regulator: da9061: BUCK and LDO regulator driver Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
  [PATCH V1 09/10] Documentation: dt: mfd: da9062/61 MFD binding Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200
    Re: [PATCH V1 09/10] Documentation: dt: mfd: da9062/61 MFD binding Rob Herring <robh@kernel.org> - 2016-10-10 15:50 +0200
  [PATCH V1 10/10] MAINTAINERS: da9062/61 updates to the Dialog  Semiconductor search terms Steve Twiss <stwiss.opensource@diasemi.com> - 2016-10-06 11:20 +0200

csiph-web