Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: int3496: Add support for binding to plain platform devices

On some X86 Android tablets the DSTD lack the INT3496 ACPI device,
while also not handling micro USB port ID pin events inside the DSDT
(instead the forked factory image kernel has things hardcoded).

The new drivers/platform/x86/x86-android-tablets.c module manually
instantiates an intel-int3496 device for these tablets.

Add support to the extcon-intel-int3496 driver to bind to devices
without an ACPI companion and export a normal platform_device
modalias for automatic module loading.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Hans de Goede and committed by
Chanwoo Choi
c26aef6d 12514f66

+13 -4
+13 -4
drivers/extcon/extcon-intel-int3496.c
··· 91 91 struct int3496_data *data; 92 92 int ret; 93 93 94 - ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios); 95 - if (ret) { 96 - dev_err(dev, "can't add GPIO ACPI mapping\n"); 97 - return ret; 94 + if (has_acpi_companion(dev)) { 95 + ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios); 96 + if (ret) { 97 + dev_err(dev, "can't add GPIO ACPI mapping\n"); 98 + return ret; 99 + } 98 100 } 99 101 100 102 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); ··· 167 165 }; 168 166 MODULE_DEVICE_TABLE(acpi, int3496_acpi_match); 169 167 168 + static const struct platform_device_id int3496_ids[] = { 169 + { .name = "intel-int3496" }, 170 + {}, 171 + }; 172 + MODULE_DEVICE_TABLE(platform, int3496_ids); 173 + 170 174 static struct platform_driver int3496_driver = { 171 175 .driver = { 172 176 .name = "intel-int3496", 173 177 .acpi_match_table = int3496_acpi_match, 174 178 }, 175 179 .probe = int3496_probe, 180 + .id_table = int3496_ids, 176 181 }; 177 182 178 183 module_platform_driver(int3496_driver);