platform/x86: x86-android-tablets: Store serdev-controller ACPI HID + UID in a union
authorHans de Goede <hdegoede@redhat.com>
Wed, 4 Dec 2024 20:42:17 +0000 (21:42 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Dec 2024 13:17:52 +0000 (15:17 +0200)
Store the serdev-controller ACPI HID + UID in a union inside struct
x86_serdev_info.

This is a preparation patch for adding support for PCI enumerated serdev-
controllers which will be done by the devfn value of the PCI device.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241204204227.95757-7-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/x86-android-tablets/asus.c
drivers/platform/x86/x86-android-tablets/core.c
drivers/platform/x86/x86-android-tablets/lenovo.c
drivers/platform/x86/x86-android-tablets/x86-android-tablets.h

index 07fbeab2319a4fe64fbe2ddff689af03a47063c3..7dde63b9943f122f4ef737ab68a1384a9795585e 100644 (file)
@@ -145,8 +145,8 @@ static const struct x86_i2c_client_info asus_me176c_i2c_clients[] __initconst =
 
 static const struct x86_serdev_info asus_me176c_serdevs[] __initconst = {
        {
-               .ctrl_hid = "80860F0A",
-               .ctrl_uid = "2",
+               .ctrl.acpi.hid = "80860F0A",
+               .ctrl.acpi.uid = "2",
                .ctrl_devname = "serial0",
                .serdev_hid = "BCM2E3A",
        },
index 3f5c83f4d0e1a88b29e85aca37e674819ba91d21..19962abba38d7e800b75733d57156da73b20aafa 100644 (file)
@@ -279,7 +279,7 @@ static __init int x86_instantiate_serdev(const struct x86_dev_info *dev_info, in
        struct device *ctrl_dev;
        int ret = -ENODEV;
 
-       ctrl_dev = get_serdev_controller(info->ctrl_hid, info->ctrl_uid, 0,
+       ctrl_dev = get_serdev_controller(info->ctrl.acpi.hid, info->ctrl.acpi.uid, 0,
                                         info->ctrl_devname);
        if (IS_ERR(ctrl_dev))
                return PTR_ERR(ctrl_dev);
index a60efbaf4817fec211792e11713da2bd6c9df432..1241a97cda399d225aa35c9f002e47b031dd47ac 100644 (file)
@@ -178,8 +178,8 @@ static const struct platform_device_info lenovo_yb1_x90_pdevs[] __initconst = {
  */
 static const struct x86_serdev_info lenovo_yb1_x90_serdevs[] __initconst = {
        {
-               .ctrl_hid = "8086228A",
-               .ctrl_uid = "1",
+               .ctrl.acpi.hid = "8086228A",
+               .ctrl.acpi.uid = "1",
                .ctrl_devname = "serial0",
                .serdev_hid = "BCM2E1A",
        },
index 0fc7e8cff6728c504bf0936efd8be1f535b7e9e6..5ddec4beb55241c1fd98837355c38dbb9d385499 100644 (file)
@@ -57,8 +57,12 @@ struct x86_spi_dev_info {
 };
 
 struct x86_serdev_info {
-       const char *ctrl_hid;
-       const char *ctrl_uid;
+       union {
+               struct {
+                       const char *hid;
+                       const char *uid;
+               } acpi;
+       } ctrl;
        const char *ctrl_devname;
        /*
         * ATM the serdev core only supports of or ACPI matching; and so far all