linux/drivers/leds/leds-pca963x.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2011 bct electronic GmbH
 * Copyright 2013 Qtechnology/AS
 *
 * Author: Peter Meerwald <[email protected]>
 * Author: Ricardo Ribalda <[email protected]>
 *
 * Based on leds-pca955x.c
 *
 * LED driver for the PCA9633 I2C LED driver (7-bit slave address 0x62)
 * LED driver for the PCA9634/5 I2C LED driver (7-bit slave address set by hw.)
 *
 * Note that hardware blinking violates the leds infrastructure driver
 * interface since the hardware only supports blinking all LEDs with the
 * same delay_on/delay_off rates.  That is, only the LEDs that are set to
 * blink will actually blink but all LEDs that are set to blink will blink
 * in identical fashion.  The delay_on/delay_off values of the last LED
 * that is set to blink will be used for all of the blinking LEDs.
 * Hardware blinking is disabled by default but can be enabled by setting
 * the 'blink_type' member in the platform_data struct to 'PCA963X_HW_BLINK'
 * or by adding the 'nxp,hw-blink' property to the DTS.
 */

#include <linux/module.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/leds.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/of.h>

/* LED select registers determine the source that drives LED outputs */
#define PCA963X_LED_OFF
#define PCA963X_LED_ON
#define PCA963X_LED_PWM
#define PCA963X_LED_GRP_PWM

#define PCA963X_MODE1_SLEEP
#define PCA963X_MODE2_OUTDRV
#define PCA963X_MODE2_INVRT
#define PCA963X_MODE2_DMBLNK

#define PCA963X_MODE1
#define PCA963X_MODE2
#define PCA963X_PWM_BASE

enum pca963x_type {};

struct pca963x_chipdef {};

static struct pca963x_chipdef pca963x_chipdefs[] =;

/* Total blink period in milliseconds */
#define PCA963X_BLINK_PERIOD_MIN
#define PCA963X_BLINK_PERIOD_MAX

static const struct i2c_device_id pca963x_id[] =;
MODULE_DEVICE_TABLE(i2c, pca963x_id);

struct pca963x;

struct pca963x_led {};

struct pca963x {};

static int pca963x_brightness(struct pca963x_led *led,
			      enum led_brightness brightness)
{}

static void pca963x_blink(struct pca963x_led *led)
{}

static int pca963x_power_state(struct pca963x_led *led)
{}

static int pca963x_led_set(struct led_classdev *led_cdev,
			   enum led_brightness value)
{}

static unsigned int pca963x_period_scale(struct pca963x_led *led,
					 unsigned int val)
{}

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

static int pca963x_register_leds(struct i2c_client *client,
				 struct pca963x *chip)
{}

static int pca963x_suspend(struct device *dev)
{}

static int pca963x_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(pca963x_pm, pca963x_suspend, pca963x_resume);

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

static int pca963x_probe(struct i2c_client *client)
{}

static struct i2c_driver pca963x_driver =;

module_i2c_driver();

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