Skip to contentSkip to conversation

staging: olpc_dcon: Convert all uses of old GPIO API to new descriptor API

PATCH New Jerry Lin 1 participant 1 message Apr 18, 2019 Staging

lore
Share & tools
lore

Jerry Lin

author
#0 lore raw

PATCH 1/1 staging: olpc_dcon: Convert all uses of old GPIO API to new descriptor API

This commit eliminate all uses of legacy integer base GPIO API in olpc_dcon_xo_1_5.c and replace them with new descriptor GPIO API like those in olpc_dcon_xo_1.c.

Also pull some common code with olpc_dcon_xo_1.c to olpc_dcon.h for code sharing.

---
 drivers/staging/olpc_dcon/olpc_dcon.h        |  5 +++
 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c   |  7 +---
 drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c | 56 ++++++++++++++++++++++++++--
 3 files changed, 58 insertions(+), 10 deletions(-)
drivers/staging/olpc_dcon/olpc_dcon.h +5 -0
index c987aaf..22d976a 100644
@@ -97,6 +97,11 @@ struct dcon_platform_data {
 	int (*read_status)(u8 *status);
 };
 
+struct dcon_gpio {
+	const char *name;
+	unsigned long flags;
+};
+
 #include <linux/interrupt.h>
 
 irqreturn_t dcon_interrupt(int irq, void *id);
drivers/staging/olpc_dcon/olpc_dcon_xo_1.c +1 -6
index a542864..02c0598 100644
@@ -26,11 +26,6 @@ enum dcon_gpios {
 	OLPC_DCON_BLANK,
 };
 
-struct dcon_gpio {
-	const char *name;
-	unsigned long flags;
-};
-
 static const struct dcon_gpio gpios_asis[] = {
 	[OLPC_DCON_STAT0] = { .name = "dcon_stat0", .flags = GPIOD_ASIS },
 	[OLPC_DCON_STAT1] = { .name = "dcon_stat1", .flags = GPIOD_ASIS },
@@ -39,7 +34,7 @@ static const struct dcon_gpio gpios_asis[] = {
 	[OLPC_DCON_BLANK] = { .name = "dcon_blank", .flags = GPIOD_ASIS },
 };
 
-struct gpio_desc *gpios[5];
+static struct gpio_desc *gpios[5];
 
 static int dcon_init_xo_1(struct dcon_priv *dcon)
 {
drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c +52 -4

86 lines not on this page · raw message

Signature · 1 line
2.7.4