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


Groups > linux.kernel > #1691072 > unrolled thread

[PATCH v2 0/3] add support for AXP22X/AXP288/AXP8XX PEK

Started byQuentin Schulz <quentin.schulz@free-electrons.com>
First post2017-07-19 09:50 +0200
Last post2017-07-19 09:50 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/3] add support for AXP22X/AXP288/AXP8XX PEK Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-07-19 09:50 +0200
    [PATCH v2 3/3] Input: axp20x-pek: add support for AXP221 PEK Quentin Schulz <quentin.schulz@free-electrons.com> - 2017-07-19 09:50 +0200

#1691072 — [PATCH v2 0/3] add support for AXP22X/AXP288/AXP8XX PEK

FromQuentin Schulz <quentin.schulz@free-electrons.com>
Date2017-07-19 09:50 +0200
Subject[PATCH v2 0/3] add support for AXP22X/AXP288/AXP8XX PEK
Message-ID<u4RU5-5ro-3@gated-at.bofh.it>
According to their datasheets, the AXP221, AXP223, AXP288, AXP803,
AXP809 and AXP813 PEK have different values for startup time bits from
the AXP20X PEK (which are currently used for all the aforementioned PMICs).

This patch series adds support for platform_device_id to axp20x-pek driver
to support different startup time bits depending on PMIC's variant and set
the correct platform_device_id in the mfd.

This has been tested on AXP813. To perform the test, modify the value of
startup and/or shutdown of the pek in sysfs. Press the button soldered to
PEK input of the AXP the amount of time you set in sysfs. The PMIC shuts
down the board without needing to unplug any power supply. Press PEK button
the amount of time you set in sysfs for startup and the PMIC will start the
board. Note that the time bits are obivoulsy hardware reset to their
default when you unplug all power supplies from the board.

v2:
  - instead of duplicating all extended attributes, use the driver_data of
  platform_device_id to get startup and shutdown times and their respective
  masks,
  - remove extended attributes and use the structure storing startup and
  shutdown times and their respective masks,
  - separate in different patches,
  - removed mfd patch to correct mfd cell name since Chen-Yu will take care
  of it in another patch series,

Thanks,
Quentin

Quentin Schulz (3):
  Input: axp20x-pek: use driver_data of platform_device_id instead of
    extended attributes
  Input: axp20x-pek: remove mention to extended attributes
  Input: axp20x-pek: add support for AXP221 PEK

 drivers/input/misc/axp20x-pek.c | 146 ++++++++++++++++++++++++++++------------
 1 file changed, 103 insertions(+), 43 deletions(-)

--
2.11.0

[toc] | [next] | [standalone]


#1691077 — [PATCH v2 3/3] Input: axp20x-pek: add support for AXP221 PEK

FromQuentin Schulz <quentin.schulz@free-electrons.com>
Date2017-07-19 09:50 +0200
Subject[PATCH v2 3/3] Input: axp20x-pek: add support for AXP221 PEK
Message-ID<u4RU7-5ro-39@gated-at.bofh.it>
In reply to#1691072
The AXP221 has different values for startup time bits from the AXP20X.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
---
 drivers/input/misc/axp20x-pek.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index fa49f45c0f0e..71fd0dc7dad4 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -56,6 +56,13 @@ static const struct axp20x_time startup_time[] = {
 	{ .time = 2000, .idx = 3 },
 };
 
+static const struct axp20x_time axp221_startup_time[] = {
+	{ .time = 128,  .idx = 0 },
+	{ .time = 1000, .idx = 1 },
+	{ .time = 2000, .idx = 2 },
+	{ .time = 3000, .idx = 3 },
+};
+
 static const struct axp20x_time shutdown_time[] = {
 	{ .time = 4000,  .idx = 0 },
 	{ .time = 6000,  .idx = 1 },
@@ -70,6 +77,13 @@ static const struct axp20x_info axp20x_info = {
 	.shutdown_mask = AXP20X_PEK_SHUTDOWN_MASK,
 };
 
+static const struct axp20x_info axp221_info = {
+	.startup_time = axp221_startup_time,
+	.startup_mask = AXP20X_PEK_STARTUP_MASK,
+	.shutdown_time = shutdown_time,
+	.shutdown_mask = AXP20X_PEK_SHUTDOWN_MASK,
+};
+
 static ssize_t axp20x_show_attr(struct device *dev,
 				const struct axp20x_time *time,
 				unsigned int mask, char *buf)
@@ -397,6 +411,9 @@ static const struct platform_device_id axp_pek_id_match[] = {
 	{
 		.name = "axp20x-pek",
 		.driver_data = (kernel_ulong_t)&axp20x_info,
+	}, {
+		.name = "axp221-pek",
+		.driver_data = (kernel_ulong_t)&axp221_info,
 	},
 };
 
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web