Source
static int lp3944_dim_set_period(struct i2c_client *client, u8 dim, u16 period)
// SPDX-License-Identifier: GPL-2.0-only
/*
* leds-lp3944.c - driver for National Semiconductor LP3944 Funlight Chip
*
* Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it>
*/
/*
* I2C driver for National Semiconductor LP3944 Funlight Chip
* http://www.national.com/pf/LP/LP3944.html
*
* This helper chip can drive up to 8 leds, with two programmable DIM modes;
* it could even be used as a gpio expander but this driver assumes it is used
* as a led controller.
*
* The DIM modes are used to set _blink_ patterns for leds, the pattern is
* specified supplying two parameters:
* - period: from 0s to 1.6s
* - duty cycle: percentage of the period the led is on, from 0 to 100
*
* LP3944 can be found on Motorola A910 smartphone, where it drives the rgb
* leds, the camera flash light and the displays backlights.
*/
/* Read Only Registers */
/* LEDs 0-7 InputRegister (Read Only) */
/* None (Read Only) */
/* Frequency Prescaler 0 (R/W) */
/* PWM Register 0 (R/W) */
/* Frequency Prescaler 1 (R/W) */
/* PWM Register 1 (R/W) */
/* LEDs 0-3 Selector (R/W) */
/* LEDs 4-7 Selector (R/W) */
/* These registers are not used to control leds in LP3944, they can store
* arbitrary values which the chip will ignore.
*/
/* period in ms */
/* duty cycle is a percentage */
/* Saved data */
struct lp3944_led_data {