History

platform/x86: int3472: Export int3472_discrete_parse_crs()

At the moment the atomisp has duplicate code for parsing Intel camera sensor GPIOS and calling the special 79234640-9e10-4fea-a5c1-b5aa8b19756f _DSM to get the GPIO type and map it to the sensor. Export int3472_discrete_parse_crs() so that the atomisp driver can reuse the INT3472 code for this.

Hans de Goede committed 1 year ago

Commit 1cfa1bb1 parent 1e5d0882 files · +13 −5Browse files

Unified · Split

2 files
  1. drivers/platform/x86/intel/int3472/discrete.c +10 −5
  2. include/linux/platform_data/x86/int3472.h +3 −0
drivers/platform/x86/intel/int3472/discrete.c+10−5
@@ -363,7 +363,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares, · 362 unmodified lines
363363 return 1;
364364 }
365365
366−static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
366+int int3472_discrete_parse_crs(struct int3472_discrete_device *int3472)
367367 {
368368 LIST_HEAD(resource_list);
369369 int ret;
@@ -388,17 +388,22 @@ static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) · 18 unmodified lines
388388
389389 return 0;
390390 }
391+EXPORT_SYMBOL_NS_GPL(int3472_discrete_parse_crs, "INTEL_INT3472_DISCRETE");
391392
392−static void skl_int3472_discrete_remove(struct platform_device *pdev)
393+void int3472_discrete_cleanup(struct int3472_discrete_device *int3472)
393394 {
394− struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev);
395−
396395 gpiod_remove_lookup_table(&int3472->gpios);
397396
398397 skl_int3472_unregister_clock(int3472);
399398 skl_int3472_unregister_pled(int3472);
400399 skl_int3472_unregister_regulator(int3472);
401400 }
401+EXPORT_SYMBOL_NS_GPL(int3472_discrete_cleanup, "INTEL_INT3472_DISCRETE");
402+
403+static void skl_int3472_discrete_remove(struct platform_device *pdev)
404+{
405+ int3472_discrete_cleanup(platform_get_drvdata(pdev));
406+}
402407
403408 static int skl_int3472_discrete_probe(struct platform_device *pdev)
404409 {
@@ -453,7 +458,7 @@ static int skl_int3472_discrete_probe(struct platform_device *pdev) · 48 unmodified lines
453458 */
454459 INIT_LIST_HEAD(&int3472->gpios.list);
455460
456− ret = skl_int3472_parse_crs(int3472);
461+ ret = int3472_discrete_parse_crs(int3472);
457462 if (ret) {
458463 skl_int3472_discrete_remove(pdev);
459464 return ret;
include/linux/platform_data/x86/int3472.h+3−0
@@ -147,6 +147,9 @@ int skl_int3472_get_sensor_adev_and_name(struct device *dev, · 146 unmodified lines
147147 struct acpi_device **sensor_adev_ret,
148148 const char **name_ret);
149149
150+int int3472_discrete_parse_crs(struct int3472_discrete_device *int3472);
151+void int3472_discrete_cleanup(struct int3472_discrete_device *int3472);
152+
150153 int skl_int3472_register_gpio_clock(struct int3472_discrete_device *int3472,
151154 struct gpio_desc *gpio);
152155 int skl_int3472_register_dsm_clock(struct int3472_discrete_device *int3472);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t