diff options
author | Jyri Sarha <jsarha@ti.com> | 2017-02-08 18:43:59 +0300 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2017-02-08 18:43:59 +0300 |
commit | 72db33355c1431fefcabb06c9c25705e8226eed5 (patch) | |
tree | e271e63f39f19e4f2b74d697170533e32f488a3d /drivers/video/fbdev/ssd1307fb.c | |
parent | b49898ce606da268fa28fef40260cad8a20ce7b0 (diff) | |
download | linux-72db33355c1431fefcabb06c9c25705e8226eed5.tar.xz |
fbdev: ssd1307fb: Start to use gpiod API for reset gpio
Start to use gpiod API for reset gpio.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: BenoƮt Cousson <bcousson@baylibre.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video/fbdev/ssd1307fb.c')
-rw-r--r-- | drivers/video/fbdev/ssd1307fb.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 2925d5ce8d3e..8ffaaeeb2f84 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -73,7 +73,7 @@ struct ssd1307fb_par { u32 prechargep2; struct pwm_device *pwm; u32 pwm_period; - int reset; + struct gpio_desc *reset; u32 seg_remap; u32 vcomh; u32 width; @@ -561,10 +561,11 @@ static int ssd1307fb_probe(struct i2c_client *client, par->device_info = of_device_get_match_data(&client->dev); - par->reset = of_get_named_gpio(client->dev.of_node, - "reset-gpios", 0); - if (!gpio_is_valid(par->reset)) { - ret = -EINVAL; + par->reset = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(par->reset)) { + dev_err(&client->dev, "failed to get reset gpio: %ld\n", + PTR_ERR(par->reset)); + ret = PTR_ERR(par->reset); goto fb_alloc_error; } @@ -642,22 +643,12 @@ static int ssd1307fb_probe(struct i2c_client *client, fb_deferred_io_init(info); - ret = devm_gpio_request_one(&client->dev, par->reset, - GPIOF_OUT_INIT_HIGH, - "oled-reset"); - if (ret) { - dev_err(&client->dev, - "failed to request gpio %d: %d\n", - par->reset, ret); - goto reset_oled_error; - } - i2c_set_clientdata(client, info); /* Reset the screen */ - gpio_set_value(par->reset, 0); + gpiod_set_value(par->reset, 0); udelay(4); - gpio_set_value(par->reset, 1); + gpiod_set_value(par->reset, 1); udelay(4); ret = ssd1307fb_init(par); |