mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 15:13:44 -04:00
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 <hdegoede@redhat.com> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20250507184737.154747-4-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
committed by
Ilpo Järvinen
parent
1e5d088a52
commit
1cfa1bb9b4
@@ -363,7 +363,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
|
||||
int int3472_discrete_parse_crs(struct int3472_discrete_device *int3472)
|
||||
{
|
||||
LIST_HEAD(resource_list);
|
||||
int ret;
|
||||
@@ -388,17 +388,22 @@ static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(int3472_discrete_parse_crs, "INTEL_INT3472_DISCRETE");
|
||||
|
||||
static void skl_int3472_discrete_remove(struct platform_device *pdev)
|
||||
void int3472_discrete_cleanup(struct int3472_discrete_device *int3472)
|
||||
{
|
||||
struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev);
|
||||
|
||||
gpiod_remove_lookup_table(&int3472->gpios);
|
||||
|
||||
skl_int3472_unregister_clock(int3472);
|
||||
skl_int3472_unregister_pled(int3472);
|
||||
skl_int3472_unregister_regulator(int3472);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(int3472_discrete_cleanup, "INTEL_INT3472_DISCRETE");
|
||||
|
||||
static void skl_int3472_discrete_remove(struct platform_device *pdev)
|
||||
{
|
||||
int3472_discrete_cleanup(platform_get_drvdata(pdev));
|
||||
}
|
||||
|
||||
static int skl_int3472_discrete_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -453,7 +458,7 @@ static int skl_int3472_discrete_probe(struct platform_device *pdev)
|
||||
*/
|
||||
INIT_LIST_HEAD(&int3472->gpios.list);
|
||||
|
||||
ret = skl_int3472_parse_crs(int3472);
|
||||
ret = int3472_discrete_parse_crs(int3472);
|
||||
if (ret) {
|
||||
skl_int3472_discrete_remove(pdev);
|
||||
return ret;
|
||||
|
||||
@@ -147,6 +147,9 @@ int skl_int3472_get_sensor_adev_and_name(struct device *dev,
|
||||
struct acpi_device **sensor_adev_ret,
|
||||
const char **name_ret);
|
||||
|
||||
int int3472_discrete_parse_crs(struct int3472_discrete_device *int3472);
|
||||
void int3472_discrete_cleanup(struct int3472_discrete_device *int3472);
|
||||
|
||||
int skl_int3472_register_gpio_clock(struct int3472_discrete_device *int3472,
|
||||
struct gpio_desc *gpio);
|
||||
int skl_int3472_register_dsm_clock(struct int3472_discrete_device *int3472);
|
||||
|
||||
Reference in New Issue
Block a user