From patchwork Sat Mar 28 18:59:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 208004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 734EDC43331 for ; Sat, 28 Mar 2020 18:59:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AC77206F6 for ; Sat, 28 Mar 2020 18:59:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kktvz/xD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727151AbgC1S7a (ORCPT ); Sat, 28 Mar 2020 14:59:30 -0400 Received: from mail-qk1-f202.google.com ([209.85.222.202]:46728 "EHLO mail-qk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726265AbgC1S71 (ORCPT ); Sat, 28 Mar 2020 14:59:27 -0400 Received: by mail-qk1-f202.google.com with SMTP id y5so4367742qky.13 for ; Sat, 28 Mar 2020 11:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=rl7WtDkNIzzT60ikOJJ0txPNPltV1gR7r9BpQuGY/24=; b=kktvz/xDC5Ag4Xmj8Jrm0AhTJwkFC/qsP3ICI3dL1lLCrOBa3csHUlKe52KKIgeqvE +86bW8xHb9NQYofFO9FAGbuK06EQF0uVZDDcvX4dSpQt63uKvll77VmDU+cVnDEhYZ2g BlEFOtQLAlKHaXDpfDsWKAtJDtClBjQ5cMyYKXBxNUPZqZVx6ckeTGFQlTTRaaolhiZC GdH36ObUiOXvsyaTuMFD+0s22cNxXMU4n0XaRzN+pKzTgbimBzVLtDEPApgVsClTk4MC OFL7DFFBF5iDe2EMb6o5ddUCtdLrsHHgBcy4g1wpQTXoBjvv4sWBuPMXvc/47au5mNg1 fGyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=rl7WtDkNIzzT60ikOJJ0txPNPltV1gR7r9BpQuGY/24=; b=qIMyWG/KiedI/6+wWGMeDCRlqZKww08uQeFv9epp94sflEh+2QgHwhpQlRILOE+HfF vxu+acGmEaTkWM9G7fVCSg7rQG5woFAeqBDh/vqUxUf0bREncTJ9vGRGb3qWi4xKQY2Z ZjMBczqBWuO8eUiaIbdz6YTtEgrQ4xbvclUBmDuMEW892X1WUA72TgGklkSxsc8jKICG HFxfSifN5tPuTGblUaxv3SkBI6blT7eLbGMOk4xJbmpUuAG4vzH3dd6tmwmc+7NS/MrW 5ANW9Jj5GXz1a6olg8XrOZTz+o3wGpEW/PmigUAb+meZFIA0PyujlbacPkswVMEGmgXL VEfQ== X-Gm-Message-State: ANhLgQ16uPmqcQA9EhjyZT97Ryw0tizaK3gg9J1/EAqerPVf2d7FRRhV DTHIPkwS5U5FxWgnk1SndqP7oW3/O+Eb X-Google-Smtp-Source: ADFU+vs2gnpUlOHy0fXAvwisX5Qfdkf3EWGsz6IBFlP2etVqkgtyIwl4tosOOeSYJ4Ov1RnVl30PVeeFZQ2t X-Received: by 2002:a05:620a:4d5:: with SMTP id 21mr4933357qks.433.1585421964138; Sat, 28 Mar 2020 11:59:24 -0700 (PDT) Date: Sat, 28 Mar 2020 11:59:12 -0700 Message-Id: <20200328185916.98423-1-rajatja@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH v4 1/5] input/serio/i8042: Attach fwnode to serio i8042 kbd device From: Rajat Jain To: Dmitry Torokhov , dtor@google.com, Rob Herring , Mark Rutland , Rajat Jain , Kate Stewart , Enrico Weigelt , Greg Kroah-Hartman , Thomas Gleixner , Allison Randal , "Rafael J. Wysocki" , Stephen Boyd , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, furquan@google.com, dlaurie@google.com, bleung@google.com, zentaro@google.com, dbehr@google.com Cc: rajatxjain@gmail.com Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Attach the firmware node to the serio i8042 kbd device so that device properties can be passed from the firmware. Signed-off-by: Rajat Jain --- v4: Same as v3 v3: same as v2 v2: Remove the Change-Id from the commit log drivers/input/serio/i8042-x86ia64io.h | 1 + drivers/input/serio/i8042.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index dc974c288e880..ed9ec4310d976 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -927,6 +927,7 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id * } i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id, sizeof(i8042_kbd_firmware_id)); + i8042_kbd_fwnode = dev_fwnode(&dev->dev); /* Keyboard ports are always supposed to be wakeup-enabled */ device_set_wakeup_enable(&dev->dev, true); diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 20ff2bed3917a..0dddf273afd94 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -124,6 +125,7 @@ MODULE_PARM_DESC(unmask_kbd_data, "Unconditional enable (may reveal sensitive da static bool i8042_bypass_aux_irq_test; static char i8042_kbd_firmware_id[128]; static char i8042_aux_firmware_id[128]; +static struct fwnode_handle *i8042_kbd_fwnode; #include "i8042.h" @@ -1335,6 +1337,7 @@ static int __init i8042_create_kbd_port(void) strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys)); strlcpy(serio->firmware_id, i8042_kbd_firmware_id, sizeof(serio->firmware_id)); + set_primary_fwnode(&serio->dev, i8042_kbd_fwnode); port->serio = serio; port->irq = I8042_KBD_IRQ; From patchwork Sat Mar 28 18:59:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 208005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41D72C2D0EC for ; Sat, 28 Mar 2020 18:59:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C90820732 for ; Sat, 28 Mar 2020 18:59:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LsfvxAZT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727356AbgC1S7b (ORCPT ); Sat, 28 Mar 2020 14:59:31 -0400 Received: from mail-pf1-f202.google.com ([209.85.210.202]:39592 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727193AbgC1S7a (ORCPT ); Sat, 28 Mar 2020 14:59:30 -0400 Received: by mail-pf1-f202.google.com with SMTP id x189so11484729pfd.6 for ; Sat, 28 Mar 2020 11:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=RmZqFhOWmJfblEL39xHqmka8Tn/Hx8czxElVow6EI48=; b=LsfvxAZTfx0EdEbqJrtv0QvW38sITdabmPyei4aZ2Hy3cyyWY8SsoAvWle9hPf5oDC ioejvTsBSCiwQsSjc2tzw9uRHh5zKQM35MiR5Jdej0EAugnnFvynwQezlZKSIaFKf+La nIHtqe5HTcqlUdFEb8uGC3sm6xVXOuKjYe9VctUSWq2rT40VMpsnwW1JlzqcHdJ/3ez7 Iqv4ChmXgPnGbUir4rlt7tTWuh4eaLA4hd2t5DdPvqYnkNloLEfog78LvamAkZV9W4++ wA5TR4ndSFw18N6W6nDejDarzS/aDW4vxFXuhtAkifBrNPgcvyAUmmDz7Cdr0CFTNk91 7fOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=RmZqFhOWmJfblEL39xHqmka8Tn/Hx8czxElVow6EI48=; b=NwBfv/Y45pep+3JUC4iTAjTkFg99OWcz+RswRNHA/OKeX9um8QxhsU0ZG3TmOjE5oM /+tC/7rrVGsA+xhCnFEAkmassJse+aqmuS/iX+tpVNJfpelJK2djGxo8PW/UetpYRSUa az4WQ2e1JTcz/Urq2ofHrZr/brg51IA+9L3P/NZbAR2VF+46v1uAuCtB2Dje6Hzny1CT WQf//2QekRFW3JtvtU3epT/UiJFVnelVn5M8S+KFjYPACrp1KoLnlFbzVzBEm2srfp+d c71iOS7nNb5XrBSX0H28OMh4W47nUbkPcDHZwSEEB334/JL4hUw9L83D1D2BqL5bUg7R iyMw== X-Gm-Message-State: ANhLgQ2extK52ED4zFteAbCZe+kdivnP8nweH5HFgoAAZV9QZGqWv7ES NbQ2S5MUAxpC0ytYzcfPyzxObKvENoZD X-Google-Smtp-Source: ADFU+vuoEMxULA3UhwesqVMltERLeDVP8XgmIuQ9z/hiaou45fh2RQVncRU3HyXUkshQHrnPQy2r2ato9pUj X-Received: by 2002:a63:4c0b:: with SMTP id z11mr5506572pga.385.1585421969560; Sat, 28 Mar 2020 11:59:29 -0700 (PDT) Date: Sat, 28 Mar 2020 11:59:14 -0700 In-Reply-To: <20200328185916.98423-1-rajatja@google.com> Message-Id: <20200328185916.98423-3-rajatja@google.com> Mime-Version: 1.0 References: <20200328185916.98423-1-rajatja@google.com> X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH v4 3/5] dt-bindings: input/atkbd.txt: Add binding for "function-row-physmap" From: Rajat Jain To: Dmitry Torokhov , dtor@google.com, Rob Herring , Mark Rutland , Rajat Jain , Kate Stewart , Enrico Weigelt , Greg Kroah-Hartman , Thomas Gleixner , Allison Randal , "Rafael J. Wysocki" , Stephen Boyd , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, furquan@google.com, dlaurie@google.com, bleung@google.com, zentaro@google.com, dbehr@google.com Cc: rajatxjain@gmail.com Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Create the documentation for the new introduced property, that describes the function-row keys physical positions. Signed-off-by: Rajat Jain --- v4: Same as v3 v3: same as v2 v2: Remove the Change-Id from the commit log .../devicetree/bindings/input/atkbd.txt | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/atkbd.txt diff --git a/Documentation/devicetree/bindings/input/atkbd.txt b/Documentation/devicetree/bindings/input/atkbd.txt new file mode 100644 index 0000000000000..816653eb8e98d --- /dev/null +++ b/Documentation/devicetree/bindings/input/atkbd.txt @@ -0,0 +1,34 @@ +Device tree bindings for AT / PS2 keyboard device + +Optional properties: + + function-row-physmap: + An ordered array of the physical codes for the function + row keys. Arranged in order from left to right. + +Example: + + This is a sample ACPI _DSD node describing the property: + + Name (_DSD, Package () { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package () { "function-row-physmap", + Package () { + 0xEA, /* T1 BACK */ + 0xE7, /* T2 REFRESH */ + 0x91, /* T3 FULLSCREEN */ + 0x92, /* T4 SCALE */ + 0x93, /* T5 SNIP */ + 0x94, /* T6 BRIGHTNESS_DOWN */ + 0x95, /* T7 BRIGHTNESS_UP */ + 0x96, /* T8 PRIVACY_SCRN_TOGGLE */ + 0x97, /* T9 KBD_BKLIGHT_DOWN */ + 0x98, /* T10 KBD_BKLIGHT_UP */ + 0xA0, /* T11 VOL_MUTE */ + 0xAE, /* T12 VOL_DOWN */ + 0xB0, /* T13 VOL_UP */ + } + } + } + }) From patchwork Sat Mar 28 18:59:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 208006 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41A1CC2D0EE for ; Sat, 28 Mar 2020 18:59:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16A5A206F6 for ; Sat, 28 Mar 2020 18:59:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Sj3kS01e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbgC1S7d (ORCPT ); Sat, 28 Mar 2020 14:59:33 -0400 Received: from mail-pl1-f201.google.com ([209.85.214.201]:39731 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbgC1S7d (ORCPT ); Sat, 28 Mar 2020 14:59:33 -0400 Received: by mail-pl1-f201.google.com with SMTP id d11so9697341pll.6 for ; Sat, 28 Mar 2020 11:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=OGNXs3NwKjk0dDeSHSXg81YijfbEbudE8mDeHpkOVOE=; b=Sj3kS01eYr5WT4Fc1GvJ9Y3z7uu2N1FDeotd7kk6k8/7QydjsRgg7y84YBxLjH/5px Ja3168nhkht1ak+6owEmdvZ08ApoeSJby75xk4dDbRLESLOVZEpdwlNibYYRZQQVR8UD AailkVpZN+syYaACa2t7ZUmwNSo67n4iSXI6fsCP6dF7GaFSttHKThBML1fByuRpO8cX nuzAJhnN2SdaZDERJ9Hgi8AUVbkgX0onXkY2nklQcYdw4djr2Ql11NDBNULzqIisWuOg SPsyx5uT6uX9ed7pM+D7tbmKQjvbQICjbFQ8LwFFQF3x+vA/VV3VuIV5vBMFqV7vdPs/ edyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=OGNXs3NwKjk0dDeSHSXg81YijfbEbudE8mDeHpkOVOE=; b=UdneL2GAHAA397QaU5wDUkh/7FKpe1S3Vv78umwoSX9JywLxNgYSYWj3RJEbVGNy6m MoHaMSbaFo2SlOVNnpdRmv3t4VQPnbrO5+VPZYG+BxrrXmCuci5JWPOgcd+HPkvvHpkQ kSBhNMbTSly/dlESkHpBmwtFaI0y9KVKx4Q1VHywyN9o2p2NoCmxVBLTSUkSkrptFpkp iY3lFN2tRryT+bzH56gAe06Dl2mj3PhSwTDlg86nMHsRA3OSLvnWUFdxuuoPAnBk7ohZ TUWJ8lbEXGJzhRbOI+7qrSO45pcNwFfwA9C8SGTW9xzeLPB7eahbRwFaAJDHsNPnIg64 HNTg== X-Gm-Message-State: ANhLgQ0KXzKQvmpdwPbuYW/XsGp6DFwd/tywfnQ0SxFqLG4eX2EiFZ6r YDLXMsTo5nKrVQKYEvwbDt+QA3uzik// X-Google-Smtp-Source: ADFU+vvC8nj/oK4By2+uBwrMdTDFPDLZ8i8ninPAa5Vf86oXT8sTO+R/ULp/peL9EAEGwoArfK8NIXRQWcTR X-Received: by 2002:a63:6d43:: with SMTP id i64mr5379169pgc.201.1585421972254; Sat, 28 Mar 2020 11:59:32 -0700 (PDT) Date: Sat, 28 Mar 2020 11:59:15 -0700 In-Reply-To: <20200328185916.98423-1-rajatja@google.com> Message-Id: <20200328185916.98423-4-rajatja@google.com> Mime-Version: 1.0 References: <20200328185916.98423-1-rajatja@google.com> X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH v4 4/5] Input: atkbd: Receive and use physcode->keycode mapping from FW From: Rajat Jain To: Dmitry Torokhov , dtor@google.com, Rob Herring , Mark Rutland , Rajat Jain , Kate Stewart , Enrico Weigelt , Greg Kroah-Hartman , Thomas Gleixner , Allison Randal , "Rafael J. Wysocki" , Stephen Boyd , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, furquan@google.com, dlaurie@google.com, bleung@google.com, zentaro@google.com, dbehr@google.com Cc: rajatxjain@gmail.com Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Allow the firmware to specify the mapping between the physical code and the linux keycode. This takes the form of a "linux,keymap" property which is an array of u32 values, each value specifying mapping for a key. Signed-off-by: Rajat Jain --- v4: Property name "keymap" -> "linux,keymap" v3: Don't save the FW mapping in atkbd device. v2: Remove the Change-Id from the commit log drivers/input/keyboard/atkbd.c | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 3b20aba1861cd..3379fb5e7169b 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -66,6 +66,9 @@ MODULE_PARM_DESC(terminal, "Enable break codes on an IBM Terminal keyboard conne #define MAX_FUNCTION_ROW_KEYS 24 +#define PHYSCODE(keymap) ((keymap >> 16) & 0xFFFF) +#define KEYCODE(keymap) (keymap & 0xFFFF) + /* * Scancode to keycode tables. These are just the default setting, and * are loadable via a userland utility. @@ -1032,6 +1035,38 @@ static unsigned int atkbd_oqo_01plus_scancode_fixup(struct atkbd *atkbd, return code; } +static int atkbd_get_keymap_from_fwnode(struct atkbd *atkbd) +{ + struct device *dev = &atkbd->ps2dev.serio->dev; + int i, n; + u32 *ptr; + u16 physcode, keycode; + + /* Parse "linux,keymap" property */ + n = device_property_count_u32(dev, "linux,keymap"); + if (n <= 0 || n > ATKBD_KEYMAP_SIZE) + return -ENXIO; + + ptr = kcalloc(n, sizeof(u32), GFP_KERNEL); + if (!ptr) + return -ENOMEM; + + if (device_property_read_u32_array(dev, "linux,keymap", ptr, n)) { + dev_err(dev, "problem parsing FW keymap property\n"); + kfree(ptr); + return -EINVAL; + } + + memset(atkbd->keycode, 0, sizeof(atkbd->keycode)); + for (i = 0; i < n; i++) { + physcode = PHYSCODE(ptr[i]); + keycode = KEYCODE(ptr[i]); + atkbd->keycode[physcode] = keycode; + } + kfree(ptr); + return 0; +} + /* * atkbd_set_keycode_table() initializes keyboard's keycode table * according to the selected scancode set @@ -1039,13 +1074,16 @@ static unsigned int atkbd_oqo_01plus_scancode_fixup(struct atkbd *atkbd, static void atkbd_set_keycode_table(struct atkbd *atkbd) { + struct device *dev = &atkbd->ps2dev.serio->dev; unsigned int scancode; int i, j; memset(atkbd->keycode, 0, sizeof(atkbd->keycode)); bitmap_zero(atkbd->force_release_mask, ATKBD_KEYMAP_SIZE); - if (atkbd->translated) { + if (!atkbd_get_keymap_from_fwnode(atkbd)) { + dev_dbg(dev, "Using FW keymap\n"); + } else if (atkbd->translated) { for (i = 0; i < 128; i++) { scancode = atkbd_unxlate_table[i]; atkbd->keycode[i] = atkbd_set2_keycode[scancode]; @@ -1173,6 +1211,7 @@ static void atkbd_parse_fwnode_data(struct serio *serio) atkbd->num_function_row_keys = n; dev_dbg(dev, "FW reported %d function-row key locations\n", n); } + } /*