dm: treewide: Rename auto_alloc_size members to be shorter
[platform/kernel/u-boot.git] / drivers / input / tegra-kbc.c
index c77f610..5113041 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  (C) Copyright 2011
  *  NVIDIA Corporation <www.nvidia.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <input.h>
 #include <keyboard.h>
 #include <key_matrix.h>
+#include <log.h>
 #include <stdio_dev.h>
 #include <tegra-kbc.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch-tegra/timer.h>
+#include <linux/delay.h>
 #include <linux/input.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 enum {
        KBC_MAX_GPIO            = 24,
        KBC_MAX_KPENT           = 8,    /* size of keypress entry queue */
@@ -290,10 +289,9 @@ static int tegra_kbd_probe(struct udevice *dev)
        struct keyboard_priv *uc_priv = dev_get_uclass_priv(dev);
        struct stdio_dev *sdev = &uc_priv->sdev;
        struct input_config *input = &uc_priv->input;
-       int node = dev->of_offset;
        int ret;
 
-       priv->kbc = (struct kbc_tegra *)dev_get_addr(dev);
+       priv->kbc = dev_read_addr_ptr(dev);
        if ((fdt_addr_t)priv->kbc == FDT_ADDR_T_NONE) {
                debug("%s: No keyboard register found\n", __func__);
                return -EINVAL;
@@ -306,7 +304,7 @@ static int tegra_kbd_probe(struct udevice *dev)
                debug("%s: Could not init key matrix: %d\n", __func__, ret);
                return ret;
        }
-       ret = key_matrix_decode_fdt(&priv->matrix, gd->fdt_blob, node);
+       ret = key_matrix_decode_fdt(dev, &priv->matrix);
        if (ret) {
                debug("%s: Could not decode key matrix from fdt: %d\n",
                      __func__, ret);
@@ -352,5 +350,5 @@ U_BOOT_DRIVER(tegra_kbd) = {
        .of_match = tegra_kbd_ids,
        .probe = tegra_kbd_probe,
        .ops    = &tegra_kbd_ops,
-       .priv_auto_alloc_size = sizeof(struct tegra_kbd_priv),
+       .priv_auto      = sizeof(struct tegra_kbd_priv),
 };