lkml.org 
[lkml]   [2020]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] platform/x86: Add new intel_atomisp2_led driver
On Sat, May 9, 2020 at 4:07 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Many Bay Trail and Cherry Trail devices come with a camera attached to
> Intel's Image Signal Processor. Linux currently does not have a driver for
> these, so they do not work as a camera.
>
> Some of these camera's have a status LED which is controlled through a GPIO
> in some cases, e.g. on the Asus T100TA and Asus T200TA, there is a firmware
> issue where the LED gets turned on at boot.
>
> This commit adds a Linux LED driver for the camera LED on these devices.
> This driver will turn the LED off at boot and also allows controlling the
> LED (so the user can repurpose it) through the sysfs LED interface.
>
> Which GPIO is attached to the LED is usually not described in the ACPI
> tables, so this driver contains per-system info about the GPIO inside the
> driver. This means that this driver only works on systems the driver knows
> about.

> +static int __init atomisp2_led_init(void)
> +{
> + const struct dmi_system_id *system;
> +
> + system = dmi_first_match(atomisp2_led_systems);
> + if (!system)
> + return -ENODEV;
> +
> + gpio_lookup = system->driver_data;
> + gpiod_add_lookup_table(gpio_lookup);
> +
> + pdev = platform_device_register_resndata(NULL,
> + DEV_NAME, PLATFORM_DEVID_NONE,
> + NULL, 0, &atomisp2_leds_pdata,
> + sizeof(atomisp2_leds_pdata));
> + if (IS_ERR(pdev)) {
> + gpiod_remove_lookup_table(gpio_lookup);

> + return PTR_ERR(pdev);
> + }
> +
> + return 0;

return PTR_ERR_OR_ZERO(...);

> +}

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-05-30 17:51    [W:0.038 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site