]> git.sur5r.net Git - u-boot/commitdiff
sandbox: Find keyboard driver using driver model
authorSimon Glass <sjg@chromium.org>
Sun, 19 Jun 2016 23:33:15 +0000 (17:33 -0600)
committerSimon Glass <sjg@chromium.org>
Mon, 11 Jul 2016 20:06:44 +0000 (14:06 -0600)
The cros-ec keyboard is always a child of the cros-ec node. Rather than
searching the device tree, looking at the children. Remove the compat string
which is now unused.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/misc/cros_ec_sandbox.c
include/fdtdec.h
lib/fdtdec.c

index 98f19a68bf6fb4b0650e69dcf06bcfebc2c349e8..c4fbca0d3ae129a260d3073fe7387b4f6688ff6b 100644 (file)
@@ -517,6 +517,7 @@ int cros_ec_probe(struct udevice *dev)
        struct ec_state *ec = dev->priv;
        struct cros_ec_dev *cdev = dev->uclass_priv;
        const void *blob = gd->fdt_blob;
+       struct udevice *keyb_dev;
        int node;
        int err;
 
@@ -525,7 +526,15 @@ int cros_ec_probe(struct udevice *dev)
        if (err)
                return err;
 
-       node = fdtdec_next_compatible(blob, 0, COMPAT_GOOGLE_CROS_EC_KEYB);
+       node = -1;
+       for (device_find_first_child(dev, &keyb_dev);
+            keyb_dev;
+            device_find_next_child(&keyb_dev)) {
+               if (device_get_uclass_id(keyb_dev) == UCLASS_KEYBOARD) {
+                       node = keyb_dev->of_offset;
+                       break;
+               }
+       }
        if (node < 0) {
                debug("%s: No cros_ec keyboard found\n", __func__);
        } else if (keyscan_read_fdt_matrix(ec, blob, node)) {
index e53d225c9706d57cf68ca224caf7b41a6b309369..151c590ed1cc366aeb9c6be0d7b3dc039af209c6 100644 (file)
@@ -134,7 +134,6 @@ enum fdt_compat_id {
        COMPAT_SAMSUNG_S3C2440_I2C,     /* Exynos I2C Controller */
        COMPAT_SAMSUNG_EXYNOS5_SOUND,   /* Exynos Sound */
        COMPAT_WOLFSON_WM8994_CODEC,    /* Wolfson WM8994 Sound Codec */
-       COMPAT_GOOGLE_CROS_EC_KEYB,     /* Google CROS_EC Keyboard */
        COMPAT_SAMSUNG_EXYNOS_USB_PHY,  /* Exynos phy controller for usb2.0 */
        COMPAT_SAMSUNG_EXYNOS5_USB3_PHY,/* Exynos phy controller for usb3.0 */
        COMPAT_SAMSUNG_EXYNOS_TMU,      /* Exynos TMU */
index 5e1a98b8afb7c2c967657164622a1ef4244c21a0..c2bcbde258a0aebead4f3cc70cb3a601eab40d51 100644 (file)
@@ -44,7 +44,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
        COMPAT(SAMSUNG_S3C2440_I2C, "samsung,s3c2440-i2c"),
        COMPAT(SAMSUNG_EXYNOS5_SOUND, "samsung,exynos-sound"),
        COMPAT(WOLFSON_WM8994_CODEC, "wolfson,wm8994-codec"),
-       COMPAT(GOOGLE_CROS_EC_KEYB, "google,cros-ec-keyb"),
        COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
        COMPAT(SAMSUNG_EXYNOS5_USB3_PHY, "samsung,exynos5250-usb3-phy"),
        COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"),