#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/led-class-flash.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <media/v4l2-flash-led-class.h>
#define RT8515_MIN_IOUT_MA …
#define RT8515_MAX_IOUT_MA …
#define RT8515_FLASH_MAX …
#define RT8515_TORCH_MAX …
#define RT8515_TIMEOUT_US …
#define RT8515_MAX_TIMEOUT_US …
struct rt8515 { … };
static struct rt8515 *to_rt8515(struct led_classdev_flash *fled)
{ … }
static void rt8515_gpio_led_off(struct rt8515 *rt)
{ … }
static void rt8515_gpio_brightness_commit(struct gpio_desc *gpiod,
int brightness)
{ … }
static int rt8515_led_brightness_set(struct led_classdev *led,
enum led_brightness brightness)
{ … }
static int rt8515_led_flash_strobe_set(struct led_classdev_flash *fled,
bool state)
{ … }
static int rt8515_led_flash_strobe_get(struct led_classdev_flash *fled,
bool *state)
{ … }
static int rt8515_led_flash_timeout_set(struct led_classdev_flash *fled,
u32 timeout)
{ … }
static const struct led_flash_ops rt8515_flash_ops = …;
static void rt8515_powerdown_timer(struct timer_list *t)
{ … }
static void rt8515_init_flash_timeout(struct rt8515 *rt)
{ … }
#if IS_ENABLED(CONFIG_V4L2_FLASH_LED_CLASS)
static void rt8515_init_v4l2_flash_config(struct rt8515 *rt,
struct v4l2_flash_config *v4l2_sd_cfg)
{ … }
static void rt8515_v4l2_flash_release(struct rt8515 *rt)
{ … }
#else
static void rt8515_init_v4l2_flash_config(struct rt8515 *rt,
struct v4l2_flash_config *v4l2_sd_cfg)
{
}
static void rt8515_v4l2_flash_release(struct rt8515 *rt)
{
}
#endif
static void rt8515_determine_max_intensity(struct rt8515 *rt,
struct fwnode_handle *led,
const char *resistance,
const char *max_ua_prop, int hw_max,
int *max_intensity_setting)
{ … }
static int rt8515_probe(struct platform_device *pdev)
{ … }
static void rt8515_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id rt8515_match[] = …;
MODULE_DEVICE_TABLE(of, rt8515_match);
static struct platform_driver rt8515_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;