[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220209225556.3992827-2-swboyd@chromium.org>
Date: Wed, 9 Feb 2022 14:55:52 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: benjamin.tissoires@...hat.com,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jiri Kosina <jikos@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
"Sean O'Brien" <seobrien@...omium.org>,
Douglas Anderson <dianders@...omium.org>,
Zhengqiao Xia <xiazhengqiao@...qin.corp-partner.google.com>
Subject: [PATCH v2 1/5] Input: atkbd: Convert function_row_physmap to u16 array
This is a u32 array because the device property is an array of u32s.
Convert this to a u16 array to save a little space and to ease the
transition to a common physmap function in the next patch.
Cc: Jiri Kosina <jikos@...nel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: "Sean O'Brien" <seobrien@...omium.org>
Cc: Douglas Anderson <dianders@...omium.org>
Cc: Zhengqiao Xia <xiazhengqiao@...qin.corp-partner.google.com>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/input/keyboard/atkbd.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index fbdef95291e9..721cde982637 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -237,7 +237,7 @@ struct atkbd {
/* Serializes reconnect(), attr->set() and event work */
struct mutex mutex;
- u32 function_row_physmap[MAX_FUNCTION_ROW_KEYS];
+ u16 function_row_physmap[MAX_FUNCTION_ROW_KEYS];
int num_function_row_keys;
};
@@ -1202,14 +1202,17 @@ static void atkbd_parse_fwnode_data(struct serio *serio)
{
struct atkbd *atkbd = serio_get_drvdata(serio);
struct device *dev = &serio->dev;
- int n;
+ int i, n;
+ u32 physmap[MAX_FUNCTION_ROW_KEYS];
/* Parse "function-row-physmap" property */
n = device_property_count_u32(dev, "function-row-physmap");
if (n > 0 && n <= MAX_FUNCTION_ROW_KEYS &&
!device_property_read_u32_array(dev, "function-row-physmap",
- atkbd->function_row_physmap, n)) {
+ physmap, n)) {
atkbd->num_function_row_keys = n;
+ for (i = 0; i < n; i++)
+ atkbd->function_row_physmap[i] = physmap[i];
dev_dbg(dev, "FW reported %d function-row key locations\n", n);
}
}
--
https://chromeos.dev
Powered by blists - more mailing lists