Commit ee6c8b5a authored by Maíra Canal's avatar Maíra Canal Committed by Inki Dae

drm/exynos: Replace legacy gpio interface for gpiod interface

Considering the current transition of the GPIO subsystem, remove all
dependencies of the legacy GPIO interface (linux/gpio.h and linux
/of_gpio.h) and replace it with the descriptor-based GPIO approach.
Signed-off-by: default avatarMaíra Canal <maira.canal@usp.br>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 1c405ca1
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/of_graph.h> #include <linux/of_graph.h>
#include <linux/phy/phy.h> #include <linux/phy/phy.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
...@@ -265,7 +264,7 @@ struct exynos_dsi { ...@@ -265,7 +264,7 @@ struct exynos_dsi {
struct clk **clks; struct clk **clks;
struct regulator_bulk_data supplies[2]; struct regulator_bulk_data supplies[2];
int irq; int irq;
int te_gpio; struct gpio_desc *te_gpio;
u32 pll_clk_rate; u32 pll_clk_rate;
u32 burst_clk_rate; u32 burst_clk_rate;
...@@ -1298,14 +1297,14 @@ static void exynos_dsi_enable_irq(struct exynos_dsi *dsi) ...@@ -1298,14 +1297,14 @@ static void exynos_dsi_enable_irq(struct exynos_dsi *dsi)
{ {
enable_irq(dsi->irq); enable_irq(dsi->irq);
if (gpio_is_valid(dsi->te_gpio)) if (dsi->te_gpio)
enable_irq(gpio_to_irq(dsi->te_gpio)); enable_irq(gpiod_to_irq(dsi->te_gpio));
} }
static void exynos_dsi_disable_irq(struct exynos_dsi *dsi) static void exynos_dsi_disable_irq(struct exynos_dsi *dsi)
{ {
if (gpio_is_valid(dsi->te_gpio)) if (dsi->te_gpio)
disable_irq(gpio_to_irq(dsi->te_gpio)); disable_irq(gpiod_to_irq(dsi->te_gpio));
disable_irq(dsi->irq); disable_irq(dsi->irq);
} }
...@@ -1335,29 +1334,20 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, ...@@ -1335,29 +1334,20 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi,
int ret; int ret;
int te_gpio_irq; int te_gpio_irq;
dsi->te_gpio = of_get_named_gpio(panel->of_node, "te-gpios", 0); dsi->te_gpio = devm_gpiod_get_optional(dsi->dev, "te", GPIOD_IN);
if (dsi->te_gpio == -ENOENT) if (IS_ERR(dsi->te_gpio)) {
return 0; dev_err(dsi->dev, "gpio request failed with %ld\n",
PTR_ERR(dsi->te_gpio));
if (!gpio_is_valid(dsi->te_gpio)) {
ret = dsi->te_gpio;
dev_err(dsi->dev, "cannot get te-gpios, %d\n", ret);
goto out; goto out;
} }
ret = gpio_request(dsi->te_gpio, "te_gpio"); te_gpio_irq = gpiod_to_irq(dsi->te_gpio);
if (ret) {
dev_err(dsi->dev, "gpio request failed with %d\n", ret);
goto out;
}
te_gpio_irq = gpio_to_irq(dsi->te_gpio);
ret = request_threaded_irq(te_gpio_irq, exynos_dsi_te_irq_handler, NULL, ret = request_threaded_irq(te_gpio_irq, exynos_dsi_te_irq_handler, NULL,
IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, "TE", dsi); IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, "TE", dsi);
if (ret) { if (ret) {
dev_err(dsi->dev, "request interrupt failed with %d\n", ret); dev_err(dsi->dev, "request interrupt failed with %d\n", ret);
gpio_free(dsi->te_gpio); gpiod_put(dsi->te_gpio);
goto out; goto out;
} }
...@@ -1367,10 +1357,9 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi, ...@@ -1367,10 +1357,9 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi,
static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi) static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi)
{ {
if (gpio_is_valid(dsi->te_gpio)) { if (dsi->te_gpio) {
free_irq(gpio_to_irq(dsi->te_gpio), dsi); free_irq(gpiod_to_irq(dsi->te_gpio), dsi);
gpio_free(dsi->te_gpio); gpiod_put(dsi->te_gpio);
dsi->te_gpio = -ENOENT;
} }
} }
...@@ -1745,9 +1734,6 @@ static int exynos_dsi_probe(struct platform_device *pdev) ...@@ -1745,9 +1734,6 @@ static int exynos_dsi_probe(struct platform_device *pdev)
if (!dsi) if (!dsi)
return -ENOMEM; return -ENOMEM;
/* To be checked as invalid one */
dsi->te_gpio = -ENOENT;
init_completion(&dsi->completed); init_completion(&dsi->completed);
spin_lock_init(&dsi->transfer_lock); spin_lock_init(&dsi->transfer_lock);
INIT_LIST_HEAD(&dsi->transfer_list); INIT_LIST_HEAD(&dsi->transfer_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment