Merge "leds: leds-qpnp-wled: correct various coding style issues"
This commit is contained in:
commit
2c9038e7d1
2 changed files with 26 additions and 33 deletions
|
@ -619,11 +619,10 @@ config LEDS_QPNP_WLED
|
||||||
tristate "Support for QPNP WLED"
|
tristate "Support for QPNP WLED"
|
||||||
depends on LEDS_CLASS && SPMI
|
depends on LEDS_CLASS && SPMI
|
||||||
help
|
help
|
||||||
This driver supports the WLED (White LED) functionality of
|
This driver supports the WLED (White LED) functionality of Qualcomm
|
||||||
Qualcomm Technologies PNP PMIC. WLED is used for display backlight.
|
Technologies, Inc. QPNP PMICs. WLED is used for LCD backlight with
|
||||||
|
variable brightness. It also supports outputting the Avdd supply for
|
||||||
To compile this driver as a module, choose M here: the module will
|
AMOLED displays.
|
||||||
be called leds-qpnp-wled.
|
|
||||||
|
|
||||||
config LEDS_SYSCON
|
config LEDS_SYSCON
|
||||||
bool "LED support for LEDs on system controllers"
|
bool "LED support for LEDs on system controllers"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -721,10 +721,11 @@ static ssize_t qpnp_wled_ramp_ms_store(struct device *dev,
|
||||||
struct device_attribute *attr, const char *buf, size_t count)
|
struct device_attribute *attr, const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct qpnp_wled *wled = dev_get_drvdata(dev);
|
struct qpnp_wled *wled = dev_get_drvdata(dev);
|
||||||
int data;
|
int data, rc;
|
||||||
|
|
||||||
if (sscanf(buf, "%d", &data) != 1)
|
rc = kstrtoint(buf, 10, &data);
|
||||||
return -EINVAL;
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
wled->ramp_ms = data;
|
wled->ramp_ms = data;
|
||||||
return count;
|
return count;
|
||||||
|
@ -744,10 +745,11 @@ static ssize_t qpnp_wled_ramp_step_store(struct device *dev,
|
||||||
struct device_attribute *attr, const char *buf, size_t count)
|
struct device_attribute *attr, const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct qpnp_wled *wled = dev_get_drvdata(dev);
|
struct qpnp_wled *wled = dev_get_drvdata(dev);
|
||||||
int data;
|
int data, rc;
|
||||||
|
|
||||||
if (sscanf(buf, "%d", &data) != 1)
|
rc = kstrtoint(buf, 10, &data);
|
||||||
return -EINVAL;
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
wled->ramp_step = data;
|
wled->ramp_step = data;
|
||||||
return count;
|
return count;
|
||||||
|
@ -832,8 +834,9 @@ static ssize_t qpnp_wled_fs_curr_ua_store(struct device *dev,
|
||||||
int data, i, rc, temp;
|
int data, i, rc, temp;
|
||||||
u8 reg;
|
u8 reg;
|
||||||
|
|
||||||
if (sscanf(buf, "%d", &data) != 1)
|
rc = kstrtoint(buf, 10, &data);
|
||||||
return -EINVAL;
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
for (i = 0; i < wled->num_strings; i++) {
|
for (i = 0; i < wled->num_strings; i++) {
|
||||||
if (data < QPNP_WLED_FS_CURR_MIN_UA)
|
if (data < QPNP_WLED_FS_CURR_MIN_UA)
|
||||||
|
@ -869,24 +872,15 @@ static ssize_t qpnp_wled_fs_curr_ua_store(struct device *dev,
|
||||||
|
|
||||||
/* sysfs attributes exported by wled */
|
/* sysfs attributes exported by wled */
|
||||||
static struct device_attribute qpnp_wled_attrs[] = {
|
static struct device_attribute qpnp_wled_attrs[] = {
|
||||||
__ATTR(dump_regs, (S_IRUGO | S_IWUSR | S_IWGRP),
|
__ATTR(dump_regs, 0664, qpnp_wled_dump_regs_show, NULL),
|
||||||
qpnp_wled_dump_regs_show,
|
__ATTR(dim_mode, 0664, qpnp_wled_dim_mode_show,
|
||||||
NULL),
|
qpnp_wled_dim_mode_store),
|
||||||
__ATTR(dim_mode, (S_IRUGO | S_IWUSR | S_IWGRP),
|
__ATTR(fs_curr_ua, 0664, qpnp_wled_fs_curr_ua_show,
|
||||||
qpnp_wled_dim_mode_show,
|
qpnp_wled_fs_curr_ua_store),
|
||||||
qpnp_wled_dim_mode_store),
|
__ATTR(start_ramp, 0664, NULL, qpnp_wled_ramp_store),
|
||||||
__ATTR(fs_curr_ua, (S_IRUGO | S_IWUSR | S_IWGRP),
|
__ATTR(ramp_ms, 0664, qpnp_wled_ramp_ms_show, qpnp_wled_ramp_ms_store),
|
||||||
qpnp_wled_fs_curr_ua_show,
|
__ATTR(ramp_step, 0664, qpnp_wled_ramp_step_show,
|
||||||
qpnp_wled_fs_curr_ua_store),
|
qpnp_wled_ramp_step_store),
|
||||||
__ATTR(start_ramp, (S_IRUGO | S_IWUSR | S_IWGRP),
|
|
||||||
NULL,
|
|
||||||
qpnp_wled_ramp_store),
|
|
||||||
__ATTR(ramp_ms, (S_IRUGO | S_IWUSR | S_IWGRP),
|
|
||||||
qpnp_wled_ramp_ms_show,
|
|
||||||
qpnp_wled_ramp_ms_store),
|
|
||||||
__ATTR(ramp_step, (S_IRUGO | S_IWUSR | S_IWGRP),
|
|
||||||
qpnp_wled_ramp_step_show,
|
|
||||||
qpnp_wled_ramp_step_store),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* worker for setting wled brightness */
|
/* worker for setting wled brightness */
|
||||||
|
@ -2196,7 +2190,7 @@ static int qpnp_wled_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct of_device_id spmi_match_table[] = {
|
static const struct of_device_id spmi_match_table[] = {
|
||||||
{ .compatible = "qcom,qpnp-wled",},
|
{ .compatible = "qcom,qpnp-wled",},
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue