Hi Neil,
Le jeu. 9 mars 2023 à 15:51, Neil Armstrong
<neil.armstrong@xxxxxxxxxx> a écrit :
+
+#include <drm/drm_crtc.h>
Is this include needed ?
Seems not, I remove it.
+ struct gpio_desc *enable_gpio;
+ struct gpio_desc *reset_gpio;
+ struct gpio_desc *dcdc_en_gpio;
Isn't this "DCDC" a regulator ???
According to the panel datasheet, this is an input signal needed
passing through TFT connector (PIN30):
"Power IC supply enable, High active"
+ /* Interface setting, video mode */
+ ret = mipi_dsi_generic_write(dsi,
+ (u8[]){DSI_REG_IS, 0x14, 0x08, 0x00, 0x22, 0x00}, 6);
+ if (ret < 0) {
+ dev_err(dev, "failed to set display interface setting: %d\n",
+ ret);
+ return ret;
+ }
Use mipi_dsi_generic_write_seq(dsi, DSI_REG_IS, 0x14, 0x08, 0x00, 0x22, 0x00); instead,
it's simpler and doesn't need explicit return check.
"mipi_dsi_generic_write_seq" doesn't exist but I will add it below
"mipi_dsi_dcs_write_seq" in drm_mipi_dsi.h
I must keep the return check to jump out of "stk_panel_init" if
something goes wrong, but I can drop the error print.
+static int stk_panel_enable(struct drm_panel *panel)
+{
+ struct stk_panel *stk = to_stk_panel(panel);
+
+ if (stk->enabled)
+ return 0;
+
+ backlight_enable(stk->backlight);
+
+ stk->enabled = true;
+
+ return 0;
+}
Is this really needed ? the backlight core will enable it automatically.
Ok, it's managed by drm_panel.c driver.
Then I can also remove stuff from stk_panel_disable.
Regards,
Alex