drivers: display: st7789v: fix function argument

The st7789v_transmit function accepts a device, not device data. As a
result, driver could not be compiled when reset GPIOs were not defined
in Devicetree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-01-31 13:18:24 +01:00 committed by Anas Nashif
commit 83cccdf757

View file

@ -104,17 +104,17 @@ static void st7789v_exit_sleep(const struct device *dev)
static void st7789v_reset_display(const struct device *dev)
{
struct st7789v_data *data = dev->data;
LOG_DBG("Resetting display");
#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
struct st7789v_data *data = dev->data;
k_sleep(K_MSEC(1));
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 1);
k_sleep(K_MSEC(6));
gpio_pin_set(data->reset_gpio, ST7789V_RESET_PIN, 0);
k_sleep(K_MSEC(20));
#else
st7789v_transmit(data, ST7789V_CMD_SW_RESET, NULL, 0);
st7789v_transmit(dev, ST7789V_CMD_SW_RESET, NULL, 0);
k_sleep(K_MSEC(5));
#endif
}