linux/drivers/leds/leds-mt6323.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * LED driver for Mediatek MT6323 PMIC
 *
 * Copyright (C) 2017 Sean Wang <[email protected]>
 */
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/mfd/mt6323/registers.h>
#include <linux/mfd/mt6397/core.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

/*
 * Register field for TOP_CKPDN0 to enable
 * 32K clock common for LED device.
 */
#define RG_DRV_32K_CK_PDN
#define RG_DRV_32K_CK_PDN_MASK

/* 32K/1M/6M clock common for WLED device */
#define RG_VWLED_1M_CK_PDN
#define RG_VWLED_32K_CK_PDN
#define RG_VWLED_6M_CK_PDN

/*
 * Register field for TOP_CKPDN2 to enable
 * individual clock for LED device.
 */
#define RG_ISINK_CK_PDN(i)
#define RG_ISINK_CK_PDN_MASK(i)

/*
 * Register field for TOP_CKCON1 to select
 * clock source.
 */
#define RG_ISINK_CK_SEL_MASK(i)

#define ISINK_CON(r, i)

/* ISINK_CON0: Register to setup the duty cycle of the blink. */
#define ISINK_DIM_DUTY_MASK
#define ISINK_DIM_DUTY(i)

/* ISINK_CON1: Register to setup the period of the blink. */
#define ISINK_DIM_FSEL_MASK
#define ISINK_DIM_FSEL(i)

/* ISINK_CON2: Register to control the brightness. */
#define ISINK_CH_STEP_SHIFT
#define ISINK_CH_STEP_MASK
#define ISINK_CH_STEP(i)
#define ISINK_SFSTR0_TC_MASK
#define ISINK_SFSTR0_TC(i)
#define ISINK_SFSTR0_EN_MASK
#define ISINK_SFSTR0_EN

/* Register to LED channel enablement. */
#define ISINK_CH_EN_MASK(i)
#define ISINK_CH_EN(i)

#define MAX_SUPPORTED_LEDS

struct mt6323_leds;

/**
 * struct mt6323_led - state container for the LED device
 * @id:			the identifier in MT6323 LED device
 * @parent:		the pointer to MT6323 LED controller
 * @cdev:		LED class device for this LED device
 * @current_brightness: current state of the LED device
 */
struct mt6323_led {};

/**
 * struct mt6323_regs - register spec for the LED device
 * @top_ckpdn:		Offset to ISINK_CKPDN[0..x] registers
 * @num_top_ckpdn:	Number of ISINK_CKPDN registers
 * @top_ckcon:		Offset to ISINK_CKCON[0..x] registers
 * @num_top_ckcon:	Number of ISINK_CKCON registers
 * @isink_con:		Offset to ISINKx_CON[0..x] registers
 * @num_isink_con:	Number of ISINKx_CON registers
 * @isink_max_regs:	Number of ISINK[0..x] registers
 * @isink_en_ctrl:	Offset to ISINK_EN_CTRL register
 * @iwled_en_ctrl:	Offset to IWLED_EN_CTRL register
 */
struct mt6323_regs {};

/**
 * struct mt6323_hwspec - hardware specific parameters
 * @max_period:		Maximum period for all LEDs
 * @max_leds:		Maximum number of supported LEDs
 * @max_wleds:		Maximum number of WLEDs
 * @max_brightness:	Maximum brightness for all LEDs
 * @unit_duty:		Steps of duty per period
 */
struct mt6323_hwspec {};

/**
 * struct mt6323_data - device specific data
 * @regs:		Register spec for this device
 * @spec:		Hardware specific parameters
 */
struct mt6323_data {};

/**
 * struct mt6323_leds -	state container for holding LED controller
 *			of the driver
 * @dev:		the device pointer
 * @hw:			the underlying hardware providing shared
 *			bus for the register operations
 * @pdata:		device specific data
 * @lock:		the lock among process context
 * @led:		the array that contains the state of individual
 *			LED device
 */
struct mt6323_leds {};

static int mt6323_led_hw_brightness(struct led_classdev *cdev,
				    enum led_brightness brightness)
{}

static int mt6323_led_hw_off(struct led_classdev *cdev)
{}

static enum led_brightness
mt6323_get_led_hw_brightness(struct led_classdev *cdev)
{}

static int mt6323_led_hw_on(struct led_classdev *cdev,
			    enum led_brightness brightness)
{}

static int mt6323_led_set_blink(struct led_classdev *cdev,
				unsigned long *delay_on,
				unsigned long *delay_off)
{}

static int mt6323_led_set_brightness(struct led_classdev *cdev,
				     enum led_brightness brightness)
{}

static int mtk_wled_hw_on(struct led_classdev *cdev)
{}

static int mtk_wled_hw_off(struct led_classdev *cdev)
{}

static enum led_brightness mt6323_get_wled_brightness(struct led_classdev *cdev)
{}

static int mt6323_wled_set_brightness(struct led_classdev *cdev,
				      enum led_brightness brightness)
{}

static int mt6323_led_set_dt_default(struct led_classdev *cdev,
				     struct device_node *np)
{}

static int mt6323_led_probe(struct platform_device *pdev)
{}

static void mt6323_led_remove(struct platform_device *pdev)
{}

static const struct mt6323_regs mt6323_registers =;

static const struct mt6323_regs mt6331_registers =;

static const struct mt6323_regs mt6332_registers =;

static const struct mt6323_hwspec mt6323_spec =;

static const struct mt6323_hwspec mt6332_spec =;

static const struct mt6323_data mt6323_pdata =;

static const struct mt6323_data mt6331_pdata =;

static const struct mt6323_data mt6332_pdata =;

static const struct of_device_id mt6323_led_dt_match[] =;
MODULE_DEVICE_TABLE(of, mt6323_led_dt_match);

static struct platform_driver mt6323_led_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();