From dc6066946eed07cb2ac7f9a4b9c19ba7ab31fd06 Mon Sep 17 00:00:00 2001 From: Piotr Mienkowski Date: Thu, 31 Jan 2019 23:36:30 +0100 Subject: [PATCH] drivers: mb_display: remove usage of gpio_port_ functions. gpio_port_ functions are being deprecated. This commit removes their usage. Signed-off-by: Piotr Mienkowski --- drivers/display/Kconfig.microbit | 10 --------- drivers/display/mb_display.c | 22 ++++++++------------ samples/boards/bbc_microbit/display/prj.conf | 1 - 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/drivers/display/Kconfig.microbit b/drivers/display/Kconfig.microbit index ef46715d90c..2a70ee0202a 100644 --- a/drivers/display/Kconfig.microbit +++ b/drivers/display/Kconfig.microbit @@ -17,16 +17,6 @@ config MICROBIT_DISPLAY if MICROBIT_DISPLAY -config MICROBIT_DISPLAY_PIN_GRANULARITY - bool "Access the GPIO on a per-pin instead of per-port basis" - help - By default, the micro:bit display driver will update the GPIO - pins of the display (pins 4 through 15) by accessing the entire - GPIO port. This is done for efficiency, however it may interfere - with other peripherals connected to the same GPIO port. Select - this option if other peripherals are connected to the same GPIO - port. - config MICROBIT_DISPLAY_STR_MAX int "Maximum length of strings that can be shown on the display" range 3 255 diff --git a/drivers/display/mb_display.c b/drivers/display/mb_display.c index 532eb21c9b0..7a18c333565 100644 --- a/drivers/display/mb_display.c +++ b/drivers/display/mb_display.c @@ -173,22 +173,18 @@ static void start_image(struct mb_display *disp, const struct mb_image *img) static inline void update_pins(struct mb_display *disp, u32_t val) { - if (IS_ENABLED(CONFIG_MICROBIT_DISPLAY_PIN_GRANULARITY)) { - u32_t pin, prev = (disp->cur + 2) % 3; + u32_t pin, prev = (disp->cur + 2) % 3; - /* Disable the previous row */ - gpio_pin_write(disp->dev, ROW_PIN(prev), 0); + /* Disable the previous row */ + gpio_pin_write(disp->dev, ROW_PIN(prev), 0); - /* Set the column pins to their correct values */ - for (pin = LED_COL1_GPIO_PIN; pin <= LED_COL9_GPIO_PIN; pin++) { - gpio_pin_write(disp->dev, pin, !!(val & BIT(pin))); - } - - /* Enable the new row */ - gpio_pin_write(disp->dev, ROW_PIN(disp->cur), 1); - } else { - gpio_port_write(disp->dev, val); + /* Set the column pins to their correct values */ + for (pin = LED_COL1_GPIO_PIN; pin <= LED_COL9_GPIO_PIN; pin++) { + gpio_pin_write(disp->dev, pin, !!(val & BIT(pin))); } + + /* Enable the new row */ + gpio_pin_write(disp->dev, ROW_PIN(disp->cur), 1); } static void reset_display(struct mb_display *disp) diff --git a/samples/boards/bbc_microbit/display/prj.conf b/samples/boards/bbc_microbit/display/prj.conf index b634d1ce1b2..cf12d62ca05 100644 --- a/samples/boards/bbc_microbit/display/prj.conf +++ b/samples/boards/bbc_microbit/display/prj.conf @@ -3,4 +3,3 @@ CONFIG_GPIO=y CONFIG_DISPLAY=y CONFIG_MICROBIT_DISPLAY=y CONFIG_SYS_CLOCK_TICKS_PER_SEC=250 -#CONFIG_MICROBIT_DISPLAY_PIN_GRANULARITY=y