#include <linux/bitops.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/led-class-flash.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <media/v4l2-flash-led-class.h>
#define RT4505_REG_RESET …
#define RT4505_REG_CONFIG …
#define RT4505_REG_ILED …
#define RT4505_REG_ENABLE …
#define RT4505_REG_FLAGS …
#define RT4505_RESET_MASK …
#define RT4505_FLASHTO_MASK …
#define RT4505_ITORCH_MASK …
#define RT4505_ITORCH_SHIFT …
#define RT4505_IFLASH_MASK …
#define RT4505_ENABLE_MASK …
#define RT4505_TORCH_SET …
#define RT4505_FLASH_SET …
#define RT4505_EXT_FLASH_SET …
#define RT4505_FLASH_GET …
#define RT4505_OVP_MASK …
#define RT4505_SHORT_MASK …
#define RT4505_OTP_MASK …
#define RT4505_TIMEOUT_MASK …
#define RT4505_ITORCH_MINUA …
#define RT4505_ITORCH_MAXUA …
#define RT4505_ITORCH_STPUA …
#define RT4505_IFLASH_MINUA …
#define RT4505_IFLASH_MAXUA …
#define RT4505_IFLASH_STPUA …
#define RT4505_FLASHTO_MINUS …
#define RT4505_FLASHTO_MAXUS …
#define RT4505_FLASHTO_STPUS …
struct rt4505_priv { … };
static int rt4505_torch_brightness_set(struct led_classdev *lcdev,
enum led_brightness level)
{ … }
static enum led_brightness rt4505_torch_brightness_get(
struct led_classdev *lcdev)
{ … }
static int rt4505_flash_brightness_set(struct led_classdev_flash *fled_cdev,
u32 brightness)
{ … }
static int rt4505_flash_strobe_set(struct led_classdev_flash *fled_cdev,
bool state)
{ … }
static int rt4505_flash_strobe_get(struct led_classdev_flash *fled_cdev,
bool *state)
{ … }
static int rt4505_flash_timeout_set(struct led_classdev_flash *fled_cdev,
u32 timeout)
{ … }
static int rt4505_fault_get(struct led_classdev_flash *fled_cdev, u32 *fault)
{ … }
static const struct led_flash_ops rt4505_flash_ops = …;
static bool rt4505_is_accessible_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config rt4505_regmap_config = …;
#if IS_ENABLED(CONFIG_V4L2_FLASH_LED_CLASS)
static int rt4505_flash_external_strobe_set(struct v4l2_flash *v4l2_flash,
bool enable)
{ … }
static const struct v4l2_flash_ops v4l2_flash_ops = …;
static void rt4505_init_v4l2_config(struct rt4505_priv *priv,
struct v4l2_flash_config *config)
{ … }
#else
static const struct v4l2_flash_ops v4l2_flash_ops;
static void rt4505_init_v4l2_config(struct rt4505_priv *priv,
struct v4l2_flash_config *config)
{
}
#endif
static void rt4505_init_flash_properties(struct rt4505_priv *priv,
struct fwnode_handle *child)
{ … }
static int rt4505_probe(struct i2c_client *client)
{ … }
static void rt4505_remove(struct i2c_client *client)
{ … }
static void rt4505_shutdown(struct i2c_client *client)
{ … }
static const struct of_device_id __maybe_unused rt4505_leds_match[] = …;
MODULE_DEVICE_TABLE(of, rt4505_leds_match);
static struct i2c_driver rt4505_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;