Skip to contentSkip to conversation

OMAP: DSS2: DSI: Support non-dcs long read

PATCH In review Arve Hjønnevåg 2 participants 7 messages Jun 30, 2011 – Aug 5, 2011 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: DSS2: DSI: Support non-dcs long read

Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073
---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/video/omap2/dss/dsi.c +6 -1
index c16b933..6975645 100644
@@ -206,6 +206,7 @@ struct dsi_reg { u16 idx; };
 #define DSI_DT_DCS_LONG_WRITE		0x39
 
 #define DSI_DT_RX_ACK_WITH_ERR		0x02
+#define DSI_DT_RX_LONG_READ		0x1a
 #define DSI_DT_RX_DCS_LONG_READ		0x1c
 #define DSI_DT_RX_SHORT_READ_1		0x21
 #define DSI_DT_RX_SHORT_READ_2		0x22
@@ -2943,6 +2944,10 @@ static u16 dsi_vc_flush_receive_data(struct platform_device *dsidev,
 		} else if (dt == DSI_DT_RX_SHORT_READ_2) {
 			DSSERR("\tDCS short response, 2 byte: %#x\n",
 					FLD_GET(val, 23, 8));
+		} else if (dt == DSI_DT_RX_LONG_READ) {
+			DSSERR("\tlong response, len %d\n",
+					FLD_GET(val, 23, 8));
+			dsi_vc_flush_long_data(dsidev, channel);
 		} else if (dt == DSI_DT_RX_DCS_LONG_READ) {
 			DSSERR("\tDCS long response, len %d\n",
 					FLD_GET(val, 23, 8));
@@ -3287,7 +3292,7 @@ int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
 		buf[1] = (data >> 8) & 0xff;
 
 		return 2;
-	} else if (dt == DSI_DT_RX_DCS_LONG_READ) {
+	} else if (dt == DSI_DT_RX_DCS_LONG_READ || dt == DSI_DT_RX_LONG_READ) {
 		int w;
 		int len = FLD_GET(val, 23, 8);
 		if (dsi->debug_read)
Signature · 6 lines
1.7.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

Hi,

Quoted 5 lines · Arve Hjønnevåg
Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073
---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

This feels somehow partial... Why do you want to read generic packets if there are no functions to send generic packets?

And always write a patch description.

Tomi

Quoted 25 lines
drivers/video/omap2/dss/dsi.c +5 -0
index c16b933..6975645 100644
@@ -206,6 +206,7 @@ struct dsi_reg { u16 idx; };
 #define DSI_DT_DCS_LONG_WRITE		0x39
 
 #define DSI_DT_RX_ACK_WITH_ERR		0x02
+#define DSI_DT_RX_LONG_READ		0x1a
 #define DSI_DT_RX_DCS_LONG_READ		0x1c
 #define DSI_DT_RX_SHORT_READ_1		0x21
 #define DSI_DT_RX_SHORT_READ_2		0x22
@@ -2943,6 +2944,10 @@ static u16 dsi_vc_flush_receive_data(struct platform_device *dsidev,
 		} else if (dt == DSI_DT_RX_SHORT_READ_2) {
 			DSSERR("\tDCS short response, 2 byte: %#x\n",
 					FLD_GET(val, 23, 8));
+		} else if (dt == DSI_DT_RX_LONG_READ) {
+			DSSERR("\tlong response, len %d\n",
+					FLD_GET(val, 23, 8));
+			dsi_vc_flush_long_data(dsidev, channel);
 		} else if (dt == DSI_DT_RX_DCS_LONG_READ) {
 			DSSERR("\tDCS long response, len %d\n",
 					FLD_GET(val, 23, 8));

drivers/video/omap2/dss/dsi.c int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, · line 3298

Quoted 8 lines
drivers/video/omap2/dss/dsi.c +1 -1
@@ -3287,7 +3292,7 @@ int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
 		buf[1] = (data >> 8) & 0xff;
 
 		return 2;
-	} else if (dt == DSI_DT_RX_DCS_LONG_READ) {
+	} else if (dt == DSI_DT_RX_DCS_LONG_READ || dt == DSI_DT_RX_LONG_READ) {
 		int w;
 		int len = FLD_GET(val, 23, 8);
 		if (dsi->debug_read)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

2011/8/4 Tomi Valkeinen <[email protected]>:

Quoted 12 lines

Hi,

Quoted 5 lines · Arve Hjønnevåg
Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073

---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-

 1 files changed, 6 insertions(+), 1 deletions(-)

This feels somehow partial... Why do you want to read generic packets if there are no functions to send generic packets?

The chip responds with a generic packet when reading from some registers. This is a simple fix while adding support for sending generic packets would probably require an api change.

Quoted 40 lines

And always write a patch description.

 Tomi

Quoted 33 lines
drivers/video/omap2/dss/dsi.c +6 -1
index c16b933..6975645 100644
@@ -206,6 +206,7 @@ struct dsi_reg { u16 idx; };
  #define DSI_DT_DCS_LONG_WRITE                0x39
 
  #define DSI_DT_RX_ACK_WITH_ERR               0x02
+#define DSI_DT_RX_LONG_READ          0x1a
  #define DSI_DT_RX_DCS_LONG_READ              0x1c
  #define DSI_DT_RX_SHORT_READ_1               0x21
  #define DSI_DT_RX_SHORT_READ_2               0x22
@@ -2943,6 +2944,10 @@ static u16 dsi_vc_flush_receive_data(struct platform_device *dsidev,
               } else if (dt == DSI_DT_RX_SHORT_READ_2) {
                       DSSERR("\tDCS short response, 2 byte: %#x\n",
                                       FLD_GET(val, 23, 8));
+             } else if (dt == DSI_DT_RX_LONG_READ) {
+                     DSSERR("\tlong response, len %d\n",
+                                     FLD_GET(val, 23, 8));
+                     dsi_vc_flush_long_data(dsidev, channel);
               } else if (dt == DSI_DT_RX_DCS_LONG_READ) {
                       DSSERR("\tDCS long response, len %d\n",
                                       FLD_GET(val, 23, 8));
@@ -3287,7 +3292,7 @@ int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
               buf[1] = (data >> 8) & 0xff;
 
               return 2;
-     } else if (dt == DSI_DT_RX_DCS_LONG_READ) {
+     } else if (dt == DSI_DT_RX_DCS_LONG_READ || dt == DSI_DT_RX_LONG_READ) {
               int w;
               int len = FLD_GET(val, 23, 8);
               if (dsi->debug_read)
Signature · 5 lines
Arve Hjønnevåg
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 10 lines · Arve Hjønnevåg

2011/8/4 Tomi Valkeinen <[email protected]>:

Quoted 9 lines

Hi,

Quoted 5 lines · Arve Hjønnevåg
Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073
---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines

This feels somehow partial... Why do you want to read generic packets if there are no functions to send generic packets?

The chip responds with a generic packet when reading from some registers. This is a simple fix while adding support for sending generic packets would probably require an api change.

What command do you use to read the register? DCS? If so, sounds rather strange HW implementation.

If you use generic commands, for which you have support in your kernel, I think it's better to add both write and read support at the same time. Adding just read support, without any way to actually use the read, doesn't sound sensible.

Tomi

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

2011/8/5 Tomi Valkeinen <[email protected]>:

Quoted 15 lines · Arve Hjønnevåg
Quoted 14 lines

2011/8/4 Tomi Valkeinen <[email protected]>:

Quoted 12 lines

Hi,

Quoted 5 lines · Arve Hjønnevåg
Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073

---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-

 1 files changed, 6 insertions(+), 1 deletions(-)

This feels somehow partial... Why do you want to read generic packets if there are no functions to send generic packets?

Quoted 7 lines
Quoted 3 lines

The chip responds with a generic packet when reading from some registers. This is a simple fix while adding support for sending generic packets would probably require an api change.

What command do you use to read the register? DCS? If so, sounds rather strange HW implementation.

This change modifies dsi_vc_dcs_read to accept a generic response packet. If you want a separate generic read command that would also work, but the it would make it a little harder to write the driver since you then would need to know what type of response the chip sends.

Quoted 5 lines

If you use generic commands, for which you have support in your kernel, I think it's better to add both write and read support at the same time. Adding just read support, without any way to actually use the read, doesn't sound sensible.

This change works with the existing read command. More commands can be added later.

Signature · 5 lines
Arve Hjønnevåg
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

Hi,

Quoted 20 lines · Arve Hjønnevåg

2011/8/5 Tomi Valkeinen <[email protected]>:

Quoted 19 lines · Arve Hjønnevåg
Quoted 17 lines

2011/8/4 Tomi Valkeinen <[email protected]>:

Quoted 12 lines

Hi,

Quoted 5 lines · Arve Hjønnevåg
Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073
---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

This feels somehow partial... Why do you want to read generic packets if there are no functions to send generic packets?

The chip responds with a generic packet when reading from some registers. This is a simple fix while adding support for sending generic packets would probably require an api change.

Quoted 5 lines
Quoted 3 lines

What command do you use to read the register? DCS? If so, sounds rather strange HW implementation.

This change modifies dsi_vc_dcs_read to accept a generic response

Ok, so you do send a DCS read command, and you get a generic response.

Quoted 4 lines

packet. If you want a separate generic read command that would also work, but the it would make it a little harder to write the driver since you then would need to know what type of response the chip sends.

Well, you do know what type of response the chip sends. According to MIPI DSI spec, a DCS read is answered with DCS short/long response, and a generic read is answered with generic short/long response.

If your HW doesn't work like that, it's against the spec. If a broken chip like that was widely used, I guess we would have to add a hack for that, but until such day I want to keep the driver working as the spec says.

Tomi

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

2011/8/5 Tomi Valkeinen <[email protected]>:

Quoted 29 lines

Hi,

Quoted 20 lines · Arve Hjønnevåg

2011/8/5 Tomi Valkeinen <[email protected]>:

Quoted 19 lines · Arve Hjønnevåg
Quoted 17 lines

2011/8/4 Tomi Valkeinen <[email protected]>:

Quoted 12 lines

Hi,

Quoted 5 lines · Arve Hjønnevåg
Change-Id I18168c887e1384c07dc033a1ffc57abdacb26073

---
 drivers/video/omap2/dss/dsi.c |    7 ++++++-

 1 files changed, 6 insertions(+), 1 deletions(-)

This feels somehow partial... Why do you want to read generic packets if there are no functions to send generic packets?

The chip responds with a generic packet when reading from some registers. This is a simple fix while adding support for sending generic packets would probably require an api change.

Quoted 5 lines
Quoted 3 lines

What command do you use to read the register? DCS? If so, sounds rather strange HW implementation.

This change modifies dsi_vc_dcs_read to accept a generic response

Quoted 8 lines

Ok, so you do send a DCS read command, and you get a generic response.

Quoted 4 lines

packet. If you want a separate generic read command that would also work, but the it would make it a little harder to write the driver since you then would need to know what type of response the chip sends.

Well, you do know what type of response the chip sends. According to

Only because the dsi_vc_dcs_read failed. The examples in the datasheet only show dcs commands and responses.

Quoted 3 lines

MIPI DSI spec, a DCS read is answered with DCS short/long response, and a generic read is answered with generic short/long response.

I don't have that spec, but if the command type dictates the response type, then I agree that having separate a generic_read command is better.

Quoted 5 lines

If your HW doesn't work like that, it's against the spec. If a broken chip like that was widely used, I guess we would have to add a hack for that, but until such day I want to keep the driver working as the spec says.

My guess is that it would also respond to a generic read, but I have not tried this since I did not know there were multiple read commands.

Signature · 5 lines
Arve Hjønnevåg
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html