Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -6069,7 +6069,7 @@ Params: 2_8_inch 2.8" 480x640
11_9_inch 11.9" 320x1480
13_3_inch_4lane 13.3" 1920x1080 4lane
13_3_inch_2lane 13.3" 1920x1080 2lane
auto_rec Automatic panel recognition (1200x1920 or
auto_detect Automatic panel detection (1200x1920 or
1920x1200 at 30fps/60fps)
i2c1 Use i2c-1 with jumper wires from GPIOs 2&3
disable_touch Disable the touch controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
7_0_inchH = <&panel>, "compatible=waveshare,7.0inch-h-panel",
<&touch>, "touchscreen-swapped-x-y?",
<&touch>, "touchscreen-inverted-x?";
auto_rec = <&panel>, "compatible=waveshare,automatic-recognition-panel",
auto_detect = <&panel>, "compatible=waveshare,automatic-detection-panel",
<&touch>, "touchscreen-swapped-x-y?",
<&touch>, "touchscreen-inverted-x?";
i2c1 = <&i2c_frag>, "target:0=",<&i2c1>,
Expand Down
19 changes: 13 additions & 6 deletions drivers/gpu/drm/panel/panel-waveshare-dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,9 @@ static int ws_panel_probe(struct i2c_client *i2c)
ts->i2c = i2c;
i2c_set_clientdata(i2c, ts);
ts->lanes = _ws_panel_data->lanes;
/*
* automatic recognition panel
*/
if (of_device_is_compatible(dev->of_node, "waveshare,automatic-recognition-panel")) {

/* For automatic detection panels, mode is NULL - detect via I2C */
if (!_ws_panel_data->mode) {
ret = ws_panel_auto_detect(ts);
if (ret) {
dev_err(dev, "panel auto detect failed\n");
Expand Down Expand Up @@ -701,10 +700,18 @@ static int ws_panel_probe(struct i2c_client *i2c)
return -ENODEV;
}

static void ws_panel_reset(struct drm_panel *panel)
{
struct ws_panel *ts = panel_to_ts(panel);

ws_panel_i2c_write(ts, 0xd2, 0x5a);
}

static void ws_panel_remove(struct i2c_client *i2c)
{
struct ws_panel *ts = i2c_get_clientdata(i2c);

ws_panel_reset(&ts->base);
ws_panel_disable(&ts->base);

drm_panel_remove(&ts->base);
Expand All @@ -714,7 +721,7 @@ static void ws_panel_shutdown(struct i2c_client *i2c)
{
struct ws_panel *ts = i2c_get_clientdata(i2c);

ws_panel_i2c_write(ts, 0xd2, 0x5a);
ws_panel_reset(&ts->base);
ws_panel_disable(&ts->base);
}

Expand Down Expand Up @@ -768,7 +775,7 @@ static const struct of_device_id ws_panel_of_ids[] = {
.compatible = "waveshare,7.0inch-h-panel",
.data = &ws_panel_7_0_h_data,
}, {
.compatible = "waveshare,automatic-recognition-panel",
.compatible = "waveshare,automatic-detection-panel",
.data = &ws_panel_automatic_data,
}, {
/* sentinel */
Expand Down
Loading