kernel-fxtec-pro1x/drivers/leds/leds.h
Subbaraman Narayanamurthy c388c4f15a leds: qpnp-flash-v2: Add support for QPNP flash v2 LED driver
QPNP Flash v2 LED driver supports the flash LED peripheral on
QTI PMICs like PMI8998, PM8150L and their derivatives to support
camera flash operation.

This is taken as a snapshot from msm-4.14 kernel
'commit 9bb584ae3a9d ("msm/sde/rotator: Add rev checks for sdmmagpie")'

This change also splits some functions to fix cyclomatic complexity
warnings.

Change-Id: I168b1e3e5ce62852f37ee2653aada90f2a75e2ec
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2018-11-06 18:19:20 -08:00

51 lines
1.3 KiB
C

/*
* LED Core
*
* Copyright 2005 Openedhand Ltd.
*
* Author: Richard Purdie <rpurdie@openedhand.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#ifndef __LEDS_H_INCLUDED
#define __LEDS_H_INCLUDED
#include <linux/rwsem.h>
#include <linux/leds.h>
static inline int led_get_brightness(struct led_classdev *led_cdev)
{
return led_cdev->brightness;
}
static inline struct led_classdev *trigger_to_lcdev(struct led_trigger *trig)
{
struct led_classdev *led_cdev;
read_lock(&trig->leddev_list_lock);
list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) {
if (!strcmp(led_cdev->default_trigger, trig->name)) {
read_unlock(&trig->leddev_list_lock);
return led_cdev;
}
}
read_unlock(&trig->leddev_list_lock);
return NULL;
}
void led_init_core(struct led_classdev *led_cdev);
void led_stop_software_blink(struct led_classdev *led_cdev);
void led_set_brightness_nopm(struct led_classdev *led_cdev,
enum led_brightness value);
void led_set_brightness_nosleep(struct led_classdev *led_cdev,
enum led_brightness value);
extern struct rw_semaphore leds_list_lock;
extern struct list_head leds_list;
extern struct list_head trigger_list;
#endif /* __LEDS_H_INCLUDED */