- Fix-ups

- Remove superfluous code; ams369fg06
    - Convert over to GPIO descriptor (gpiod); bd6107
 
  - Bug Fixes
    - Fix unsigned comparison to less than zero; qcom-wled
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAl44GtkACgkQUa+KL4f8
 d2FNWRAAm1Zm7U/X1dKq51N9+2L0nIBY5+5Bq13JwR9o1TxCLn9wdQEUkyX94DlD
 ysPBpY+xcUTjHbhQT90ax8hTeb4Zrg5Dolz3u920Jmt+ei68ez2Pwivx6DrWeu2G
 RGHlNwv847Ycf3ejq8OvnlQPbGDuRcjeKhx65sx0hGG2f3NodpaD5AAlpOyVCkU5
 gL1V6YxzkwD9nukEo27W3O5nyEKIqslVtEzX9kTCQ7O1GUgGru00aMlde7+vcfxV
 +sCQNN2lVel1zmr/2/uy5FINGoBLqsS9Mbgis9Cz79s9hNdaiETgL7KrOQrWgY+Z
 puKaFSz81I4Z78x5yDi0ScLE7UExh6ngu/NRD/FMEhec7azQ6y8jsV6HXiTgrceX
 ZiU4th8ej6NFXItKH34iPGJ9VN+3DtCS4t29o7XEAfS4vR5c5WQSdUeZnfEUVu+1
 5z012XW7p+MuSYBEix4Z60cSKtfL/9TbMvbaaR7cfYDlYmt1eLmNrLAoTe07hd5X
 1d7lD2ONqUQQssoRqjHH7fyvQbctwF6jSTupwH5agULEAfYIRLyO0GTVCfwjBPRK
 1JizRShCZmqAAsqMBYwgRZ33tsJxV11jg4Ri0mr8FHVJUsbKzySKO46+eFUqq0fo
 fEt//Q4EB3IfVN0ATa5A8XPlZdlNSSwYGN66liO1iNsCXL8FWWU=
 =xgab
 -----END PGP SIGNATURE-----

Merge tag 'backlight-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 "Fix-ups:
   - Remove superfluous code in ams369fg06
   - Convert over to GPIO descriptor (gpiod) in bd6107

  Bug Fixes:
   - Fix unsigned comparison to less than zero in qcom-wled"

* tag 'backlight-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: qcom-wled: Fix unsigned comparison to zero
  backlight: bd6107: Convert to use GPIO descriptor
  backlight: ams369fg06: Drop GPIO include
This commit is contained in:
Linus Torvalds 2020-02-03 14:55:08 +00:00
commit 2367da5b51
4 changed files with 18 additions and 12 deletions

View File

@ -11,7 +11,6 @@
#include <linux/backlight.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/gpio.h>
#include <linux/lcd.h>
#include <linux/module.h>
#include <linux/spi/spi.h>

View File

@ -11,7 +11,7 @@
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/fb.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/platform_data/bd6107.h>
@ -71,6 +71,7 @@ struct bd6107 {
struct i2c_client *client;
struct backlight_device *backlight;
struct bd6107_platform_data *pdata;
struct gpio_desc *reset;
};
static int bd6107_write(struct bd6107 *bd, u8 reg, u8 data)
@ -94,9 +95,10 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight)
bd6107_write(bd, BD6107_MAINCNT1, brightness);
bd6107_write(bd, BD6107_LEDCNT1, BD6107_LEDCNT1_LEDONOFF1);
} else {
gpio_set_value(bd->pdata->reset, 0);
/* Assert the reset line (gpiolib will handle active low) */
gpiod_set_value(bd->reset, 1);
msleep(24);
gpio_set_value(bd->pdata->reset, 1);
gpiod_set_value(bd->reset, 0);
}
return 0;
@ -125,8 +127,8 @@ static int bd6107_probe(struct i2c_client *client,
struct bd6107 *bd;
int ret;
if (pdata == NULL || !pdata->reset) {
dev_err(&client->dev, "No reset GPIO in platform data\n");
if (pdata == NULL) {
dev_err(&client->dev, "No platform data\n");
return -EINVAL;
}
@ -144,10 +146,16 @@ static int bd6107_probe(struct i2c_client *client,
bd->client = client;
bd->pdata = pdata;
ret = devm_gpio_request_one(&client->dev, pdata->reset,
GPIOF_DIR_OUT | GPIOF_INIT_LOW, "reset");
if (ret < 0) {
/*
* Request the reset GPIO line with GPIOD_OUT_HIGH meaning asserted,
* so in the machine descriptor table (or other hardware description),
* the line should be flagged as active low so this will assert
* the reset.
*/
bd->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(bd->reset)) {
dev_err(&client->dev, "unable to request reset GPIO\n");
ret = PTR_ERR(bd->reset);
return ret;
}

View File

@ -956,8 +956,8 @@ static int wled_configure(struct wled *wled, int version)
struct wled_config *cfg = &wled->cfg;
struct device *dev = wled->dev;
const __be32 *prop_addr;
u32 size, val, c, string_len;
int rc, i, j;
u32 size, val, c;
int rc, i, j, string_len;
const struct wled_u32_opts *u32_opts = NULL;
const struct wled_u32_opts wled3_opts[] = {

View File

@ -9,7 +9,6 @@ struct device;
struct bd6107_platform_data {
struct device *fbdev;
int reset; /* Reset GPIO */
unsigned int def_value;
};