Skip to content

Commit 1cfa1bb

Browse files
jwrdegoedeij-intel
authored andcommitted
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. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 1e5d088 commit 1cfa1bb

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

drivers/platform/x86/intel/int3472/discrete.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
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)
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)
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ int skl_int3472_get_sensor_adev_and_name(struct device *dev,
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);

0 commit comments

Comments
 (0)