linux/drivers/leds/blink/leds-lgm-sso.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Intel Lightning Mountain SoC LED Serial Shift Output Controller driver
 *
 * Copyright (c) 2020 Intel Corporation.
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/sizes.h>
#include <linux/uaccess.h>

#define SSO_DEV_NAME

#define LED_BLINK_H8_0
#define LED_BLINK_H8_1
#define GET_FREQ_OFFSET(pin, src)
#define GET_SRC_OFFSET(pinc)

#define DUTY_CYCLE(x)
#define SSO_CON0
#define SSO_CON0_RZFL
#define SSO_CON0_BLINK_R
#define SSO_CON0_SWU

#define SSO_CON1
#define SSO_CON1_FCDSC
#define SSO_CON1_FPID
#define SSO_CON1_GPTD
#define SSO_CON1_US

#define SSO_CPU
#define SSO_CON2
#define SSO_CON3

/* Driver MACRO */
#define MAX_PIN_NUM_PER_BANK
#define MAX_GROUP_NUM
#define PINS_PER_GROUP
#define FPID_FREQ_RANK_MAX
#define SSO_LED_MAX_NUM
#define MAX_FREQ_RANK
#define DEF_GPTC_CLK_RATE
#define SSO_DEF_BRIGHTNESS
#define DATA_CLK_EDGE

static const u32 freq_div_tbl[] =;
static const int freq_tbl[] =;
static const int shift_clk_freq_tbl[] =;

/*
 * Update Source to update the SOUTs
 * SW - Software has to update the SWU bit
 * GPTC - General Purpose timer is used as clock source
 * FPID - Divided FSC clock (FPID) is used as clock source
 */
enum {};

enum {};

enum {};

enum {};

enum {};

struct sso_led_priv;

struct sso_led_desc {};

struct sso_led {};

struct sso_gpio {};

struct sso_led_priv {};

static int sso_get_blink_rate_idx(struct sso_led_priv *priv, u32 rate)
{}

static unsigned int sso_led_pin_to_group(u32 pin)
{}

static u32 sso_led_get_freq_src(int freq_idx)
{}

static u32 sso_led_pin_blink_off(u32 pin, unsigned int group)
{}

static struct sso_led
*cdev_to_sso_led_data(struct led_classdev *led_cdev)
{}

static void sso_led_freq_set(struct sso_led_priv *priv, u32 pin, int freq_idx)
{}

static void sso_led_brightness_set(struct led_classdev *led_cdev,
				   enum led_brightness brightness)
{}

static enum led_brightness sso_led_brightness_get(struct led_classdev *led_cdev)
{}

static int
delay_to_freq_idx(struct sso_led *led, unsigned long *delay_on,
		  unsigned long *delay_off)
{}

static int
sso_led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
		  unsigned long *delay_off)
{}

static void sso_led_hw_cfg(struct sso_led_priv *priv, struct sso_led *led)
{}

static int sso_create_led(struct sso_led_priv *priv, struct sso_led *led,
			  struct fwnode_handle *child)
{}

static void sso_init_freq(struct sso_led_priv *priv)
{}

static int sso_gpio_request(struct gpio_chip *chip, unsigned int offset)
{}

static void sso_gpio_free(struct gpio_chip *chip, unsigned int offset)
{}

static int sso_gpio_get_dir(struct gpio_chip *chip, unsigned int offset)
{}

static int
sso_gpio_dir_out(struct gpio_chip *chip, unsigned int offset, int value)
{}

static int sso_gpio_get(struct gpio_chip *chip, unsigned int offset)
{}

static void sso_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
{}

static int sso_gpio_gc_init(struct device *dev, struct sso_led_priv *priv)
{}

static int sso_gpio_get_freq_idx(int freq)
{}

static void sso_register_shift_clk(struct sso_led_priv *priv)
{}

static int sso_gpio_freq_set(struct sso_led_priv *priv)
{}

static int sso_gpio_hw_init(struct sso_led_priv *priv)
{}

static void sso_led_shutdown(struct sso_led *led)
{}

static int
__sso_led_dt_parse(struct sso_led_priv *priv, struct fwnode_handle *fw_ssoled)
{}

static int sso_led_dt_parse(struct sso_led_priv *priv)
{}

static int sso_probe_gpios(struct sso_led_priv *priv)
{}

static void sso_clock_disable_unprepare(void *data)
{}

static int intel_sso_led_probe(struct platform_device *pdev)
{}

static void intel_sso_led_remove(struct platform_device *pdev)
{}

static const struct of_device_id of_sso_led_match[] =;

MODULE_DEVICE_TABLE(of, of_sso_led_match);

static struct platform_driver intel_sso_led_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();