Hi,

On 07.10.2022 14:14, Nia Espera wrote:

+
+#define dsi_dcs_write_seq(dsi, seq...) do {                            \
+               static const u8 d[] = { seq };                          \
+               int ret;                                                \
+               ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d)); \
+               if (ret < 0)                                         \
+                       return ret;                                     \
+       } while (0)
+

There is now a standard macro for this - mipi_dsi_dcs_write_seq() [1] , so you don't need to reinvent it.

+static void samsung_s6e3fc2x01_reset(struct samsung_s6e3fc2x01 *ctx)
+{
+       gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+       usleep_range(5000, 6000);
+       gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+       usleep_range(2000, 3000);
+       gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+       usleep_range(10000, 11000);
+}

There is a high chance that first gpiod_set_value() is not needed, only the last 2.

[1] https://elixir.bootlin.com/linux/latest/C/ident/mipi_dsi_dcs_write_seq

--
Regards
Alexey Minnekhanov

Reply via email to