* [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support
@ 2017-08-10 6:45 Tomi Valkeinen
2017-08-10 7:22 ` Laurent Pinchart
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Tomi Valkeinen @ 2017-08-10 6:45 UTC (permalink / raw)
To: dri-devel, Laurent Pinchart
Cc: H . Nikolaus Schaller, Tomi Valkeinen, linux-omap
We are missing OMAP5 DSIPHY lane-enable support, which has prevented
OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
to the recently added OMAP4 version.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
Based on Laurent's recent omapdrm series.
drivers/gpu/drm/omapdrm/dss/dsi.c | 50 +++++++++++++++++++++++++++++++++++----
1 file changed, 45 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index a66d2b1a6c74..1f0b29af9b86 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -2139,14 +2139,51 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
return 0;
}
+#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
+
+#define OMAP5_DSI1_LANEENABLE_SHIFT 24
+#define OMAP5_DSI2_LANEENABLE_SHIFT 19
+#define OMAP5_DSI_LANEENABLE_MASK 0x1f
+
+static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
+{
+ u32 enable_mask, enable_shift, reg;
+
+ if (!dsi->syscon)
+ return 0;
+
+ if (dsi->module_id == 0)
+ enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
+ else if (dsi->module_id == 1)
+ enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
+ else
+ return -ENODEV;
+
+ enable_mask = OMAP5_DSI_LANEENABLE_MASK << enable_shift;
+
+ regmap_read(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, ®);
+ reg &= ~enable_mask;
+ reg |= (lanes << enable_shift) & enable_mask;
+ regmap_write(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, reg);
+
+ return 0;
+}
+
static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
{
- return dsi_omap4_mux_pads(dsi, lane_mask);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ return dsi_omap4_mux_pads(dsi, lane_mask);
+ if (dsi->data->model == DSI_MODEL_OMAP5)
+ return dsi_omap5_mux_pads(dsi, lane_mask);
+ return 0;
}
static void dsi_disable_pads(struct dsi_data *dsi)
{
- dsi_omap4_mux_pads(dsi, 0);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ dsi_omap4_mux_pads(dsi, 0);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ dsi_omap5_mux_pads(dsi, 0);
}
static int dsi_cio_init(struct platform_device *dsidev)
@@ -5480,14 +5517,17 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
dsi->module_id = d->id;
- if (dsi->data->model == DSI_MODEL_OMAP4) {
+ if (dsi->data->model == DSI_MODEL_OMAP4 ||
+ dsi->data->model == DSI_MODEL_OMAP5) {
struct device_node *np;
/*
- * The OMAP4 display DT bindings don't reference the padconf
+ * The OMAP4/5 display DT bindings don't reference the padconf
* syscon. Our only option to retrieve it is to find it by name.
*/
- np = of_find_node_by_name(NULL, "omap4_padconf_global");
+ np = of_find_node_by_name(NULL,
+ dsi->data->model == DSI_MODEL_OMAP4 ?
+ "omap4_padconf_global" : "omap5_padconf_global");
if (!np)
return -ENODEV;
--
2.7.4
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support
2017-08-10 6:45 [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
@ 2017-08-10 7:22 ` Laurent Pinchart
2017-08-10 8:28 ` Tomi Valkeinen
2017-08-10 9:44 ` [PATCHv2] " Tomi Valkeinen
2017-08-10 12:29 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Tomi Valkeinen
2 siblings, 1 reply; 9+ messages in thread
From: Laurent Pinchart @ 2017-08-10 7:22 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: H . Nikolaus Schaller, linux-omap, dri-devel
Hi Tomi,
Thank you for the patch.
On Thursday 10 Aug 2017 09:45:20 Tomi Valkeinen wrote:
> We are missing OMAP5 DSIPHY lane-enable support, which has prevented
> OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
> to the recently added OMAP4 version.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>
> Based on Laurent's recent omapdrm series.
>
> drivers/gpu/drm/omapdrm/dss/dsi.c | 50 +++++++++++++++++++++++++++++++----
> 1 file changed, 45 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c
> b/drivers/gpu/drm/omapdrm/dss/dsi.c index a66d2b1a6c74..1f0b29af9b86 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -2139,14 +2139,51 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) return 0;
> }
>
> +#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
> +
> +#define OMAP5_DSI1_LANEENABLE_SHIFT 24
> +#define OMAP5_DSI2_LANEENABLE_SHIFT 19
> +#define OMAP5_DSI_LANEENABLE_MASK 0x1f
> +
> +static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
> +{
> + u32 enable_mask, enable_shift, reg;
> +
> + if (!dsi->syscon)
> + return 0;
The purpose of this check in dsi_omap4_mux_pads() was to handle the SoCs that
don't require any driver action to mux the DSI pins. Now that
dsi_enable_pads() and dsi_disable_pads() have new SoC checks, this isn't
needed anymore, dsi->syscon can't be NULL on OMAP4 or OMAP5.
> + if (dsi->module_id == 0)
> + enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
> + else if (dsi->module_id == 1)
> + enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
> + else
> + return -ENODEV;
> +
> + enable_mask = OMAP5_DSI_LANEENABLE_MASK << enable_shift;
> +
> + regmap_read(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, ®);
> + reg &= ~enable_mask;
> + reg |= (lanes << enable_shift) & enable_mask;
> + regmap_write(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, reg);
> +
> + return 0;
> +}
> +
> static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
> {
> - return dsi_omap4_mux_pads(dsi, lane_mask);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
> + return dsi_omap4_mux_pads(dsi, lane_mask);
> + if (dsi->data->model == DSI_MODEL_OMAP5)
> + return dsi_omap5_mux_pads(dsi, lane_mask);
> + return 0;
> }
>
> static void dsi_disable_pads(struct dsi_data *dsi)
> {
> - dsi_omap4_mux_pads(dsi, 0);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
> + dsi_omap4_mux_pads(dsi, 0);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
Did you mean DSI_MODEL_OMAP5 ? As the two are mutually exclusive, I would use
an "else if".
> + dsi_omap5_mux_pads(dsi, 0);
> }
>
> static int dsi_cio_init(struct platform_device *dsidev)
> @@ -5480,14 +5517,17 @@ static int dsi_bind(struct device *dev, struct
> device *master, void *data)
>
> dsi->module_id = d->id;
>
> - if (dsi->data->model == DSI_MODEL_OMAP4) {
> + if (dsi->data->model == DSI_MODEL_OMAP4 ||
> + dsi->data->model == DSI_MODEL_OMAP5) {
> struct device_node *np;
>
> /*
> - * The OMAP4 display DT bindings don't reference the padconf
> + * The OMAP4/5 display DT bindings don't reference the padconf
> * syscon. Our only option to retrieve it is to find it by
name.
> */
> - np = of_find_node_by_name(NULL, "omap4_padconf_global");
> + np = of_find_node_by_name(NULL,
> + dsi->data->model == DSI_MODEL_OMAP4 ?
> + "omap4_padconf_global" : "omap5_padconf_global");
> if (!np)
> return -ENODEV;
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support
2017-08-10 7:22 ` Laurent Pinchart
@ 2017-08-10 8:28 ` Tomi Valkeinen
0 siblings, 0 replies; 9+ messages in thread
From: Tomi Valkeinen @ 2017-08-10 8:28 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: H . Nikolaus Schaller, linux-omap, dri-devel
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
This message contains a digitally signed email which can be read by opening the attachment.
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
[-- Attachment #2: Type: message/rfc822, Size: 6200 bytes --]
[-- Attachment #2.1.1.1: Type: text/plain, Size: 2891 bytes --]
Hi,
On 10/08/17 10:22, Laurent Pinchart wrote:
> Hi Tomi,
>
> Thank you for the patch.
>
> On Thursday 10 Aug 2017 09:45:20 Tomi Valkeinen wrote:
>> We are missing OMAP5 DSIPHY lane-enable support, which has prevented
>> OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
>> to the recently added OMAP4 version.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>
>> Based on Laurent's recent omapdrm series.
>>
>> drivers/gpu/drm/omapdrm/dss/dsi.c | 50 +++++++++++++++++++++++++++++++----
>> 1 file changed, 45 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c
>> b/drivers/gpu/drm/omapdrm/dss/dsi.c index a66d2b1a6c74..1f0b29af9b86 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
>> @@ -2139,14 +2139,51 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
>> unsigned int lanes) return 0;
>> }
>>
>> +#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
>> +
>> +#define OMAP5_DSI1_LANEENABLE_SHIFT 24
>> +#define OMAP5_DSI2_LANEENABLE_SHIFT 19
>> +#define OMAP5_DSI_LANEENABLE_MASK 0x1f
>> +
>> +static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
>> +{
>> + u32 enable_mask, enable_shift, reg;
>> +
>> + if (!dsi->syscon)
>> + return 0;
>
> The purpose of this check in dsi_omap4_mux_pads() was to handle the SoCs that
> don't require any driver action to mux the DSI pins. Now that
> dsi_enable_pads() and dsi_disable_pads() have new SoC checks, this isn't
> needed anymore, dsi->syscon can't be NULL on OMAP4 or OMAP5.
True, I'll drop the check.
>> + if (dsi->module_id == 0)
>> + enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
>> + else if (dsi->module_id == 1)
>> + enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
>> + else
>> + return -ENODEV;
>> +
>> + enable_mask = OMAP5_DSI_LANEENABLE_MASK << enable_shift;
>> +
>> + regmap_read(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, ®);
>> + reg &= ~enable_mask;
>> + reg |= (lanes << enable_shift) & enable_mask;
>> + regmap_write(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, reg);
>> +
>> + return 0;
>> +}
>> +
>> static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
>> {
>> - return dsi_omap4_mux_pads(dsi, lane_mask);
>> + if (dsi->data->model == DSI_MODEL_OMAP4)
>> + return dsi_omap4_mux_pads(dsi, lane_mask);
>> + if (dsi->data->model == DSI_MODEL_OMAP5)
>> + return dsi_omap5_mux_pads(dsi, lane_mask);
>> + return 0;
>> }
>>
>> static void dsi_disable_pads(struct dsi_data *dsi)
>> {
>> - dsi_omap4_mux_pads(dsi, 0);
>> + if (dsi->data->model == DSI_MODEL_OMAP4)
>> + dsi_omap4_mux_pads(dsi, 0);
>> + if (dsi->data->model == DSI_MODEL_OMAP4)
>
> Did you mean DSI_MODEL_OMAP5 ? As the two are mutually exclusive, I would use
> an "else if".
Indeed, it should be OMAP5.
Tomi
[-- Attachment #2.1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCHv2] drm/omap: add OMAP5 DSIPHY lane-enable support
2017-08-10 6:45 [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
2017-08-10 7:22 ` Laurent Pinchart
@ 2017-08-10 9:44 ` Tomi Valkeinen
2017-08-10 10:31 ` Laurent Pinchart
2017-08-10 12:29 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Tomi Valkeinen
2 siblings, 1 reply; 9+ messages in thread
From: Tomi Valkeinen @ 2017-08-10 9:44 UTC (permalink / raw)
To: dri-devel, Laurent Pinchart
Cc: H . Nikolaus Schaller, Tomi Valkeinen, linux-omap
We are missing OMAP5 DSIPHY lane-enable support, which has prevented
OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
to the recently added OMAP4 version.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
Changes:
- Fixed the check for DSI model
- Use else if
- Drop the unnecessary syscon check
drivers/gpu/drm/omapdrm/dss/dsi.c | 50 ++++++++++++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index a66d2b1a6c74..889f2d30050b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -2109,9 +2109,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
u32 pipd_mask, pipd_shift;
u32 reg;
- if (!dsi->syscon)
- return 0;
-
if (dsi->module_id == 0) {
enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
@@ -2139,14 +2136,48 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
return 0;
}
+#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
+
+#define OMAP5_DSI1_LANEENABLE_SHIFT 24
+#define OMAP5_DSI2_LANEENABLE_SHIFT 19
+#define OMAP5_DSI_LANEENABLE_MASK 0x1f
+
+static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
+{
+ u32 enable_mask, enable_shift, reg;
+
+ if (dsi->module_id == 0)
+ enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
+ else if (dsi->module_id == 1)
+ enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
+ else
+ return -ENODEV;
+
+ enable_mask = OMAP5_DSI_LANEENABLE_MASK << enable_shift;
+
+ regmap_read(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, ®);
+ reg &= ~enable_mask;
+ reg |= (lanes << enable_shift) & enable_mask;
+ regmap_write(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, reg);
+
+ return 0;
+}
+
static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
{
- return dsi_omap4_mux_pads(dsi, lane_mask);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ return dsi_omap4_mux_pads(dsi, lane_mask);
+ if (dsi->data->model == DSI_MODEL_OMAP5)
+ return dsi_omap5_mux_pads(dsi, lane_mask);
+ return 0;
}
static void dsi_disable_pads(struct dsi_data *dsi)
{
- dsi_omap4_mux_pads(dsi, 0);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ dsi_omap4_mux_pads(dsi, 0);
+ else if (dsi->data->model == DSI_MODEL_OMAP5)
+ dsi_omap5_mux_pads(dsi, 0);
}
static int dsi_cio_init(struct platform_device *dsidev)
@@ -5480,14 +5511,17 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
dsi->module_id = d->id;
- if (dsi->data->model == DSI_MODEL_OMAP4) {
+ if (dsi->data->model == DSI_MODEL_OMAP4 ||
+ dsi->data->model == DSI_MODEL_OMAP5) {
struct device_node *np;
/*
- * The OMAP4 display DT bindings don't reference the padconf
+ * The OMAP4/5 display DT bindings don't reference the padconf
* syscon. Our only option to retrieve it is to find it by name.
*/
- np = of_find_node_by_name(NULL, "omap4_padconf_global");
+ np = of_find_node_by_name(NULL,
+ dsi->data->model == DSI_MODEL_OMAP4 ?
+ "omap4_padconf_global" : "omap5_padconf_global");
if (!np)
return -ENODEV;
--
2.7.4
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCHv2] drm/omap: add OMAP5 DSIPHY lane-enable support
2017-08-10 9:44 ` [PATCHv2] " Tomi Valkeinen
@ 2017-08-10 10:31 ` Laurent Pinchart
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2017-08-10 10:31 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: H . Nikolaus Schaller, linux-omap, dri-devel
Hi Tomi,
Thank you for the patch.
On Thursday 10 Aug 2017 12:44:01 Tomi Valkeinen wrote:
> We are missing OMAP5 DSIPHY lane-enable support, which has prevented
> OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
> to the recently added OMAP4 version.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>
> Changes:
>
> - Fixed the check for DSI model
> - Use else if
> - Drop the unnecessary syscon check
>
> drivers/gpu/drm/omapdrm/dss/dsi.c | 50 +++++++++++++++++++++++++++++-------
> 1 file changed, 42 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c
> b/drivers/gpu/drm/omapdrm/dss/dsi.c index a66d2b1a6c74..889f2d30050b 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -2109,9 +2109,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) u32 pipd_mask, pipd_shift;
> u32 reg;
>
> - if (!dsi->syscon)
> - return 0;
> -
> if (dsi->module_id == 0) {
> enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
> enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
> @@ -2139,14 +2136,48 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) return 0;
> }
>
> +#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
> +
> +#define OMAP5_DSI1_LANEENABLE_SHIFT 24
> +#define OMAP5_DSI2_LANEENABLE_SHIFT 19
> +#define OMAP5_DSI_LANEENABLE_MASK 0x1f
> +
> +static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
> +{
> + u32 enable_mask, enable_shift, reg;
> +
> + if (dsi->module_id == 0)
> + enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
> + else if (dsi->module_id == 1)
> + enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
> + else
> + return -ENODEV;
> +
> + enable_mask = OMAP5_DSI_LANEENABLE_MASK << enable_shift;
> +
> + regmap_read(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, ®);
> + reg &= ~enable_mask;
> + reg |= (lanes << enable_shift) & enable_mask;
> + regmap_write(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET, reg);
I should have spot that during the first review, but I think
regmap_update_bits() would be more efficient, and would also benefit from
internal regmap locking.
Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +
> + return 0;
> +}
> +
> static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
> {
> - return dsi_omap4_mux_pads(dsi, lane_mask);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
> + return dsi_omap4_mux_pads(dsi, lane_mask);
> + if (dsi->data->model == DSI_MODEL_OMAP5)
> + return dsi_omap5_mux_pads(dsi, lane_mask);
> + return 0;
> }
>
> static void dsi_disable_pads(struct dsi_data *dsi)
> {
> - dsi_omap4_mux_pads(dsi, 0);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
> + dsi_omap4_mux_pads(dsi, 0);
> + else if (dsi->data->model == DSI_MODEL_OMAP5)
> + dsi_omap5_mux_pads(dsi, 0);
> }
>
> static int dsi_cio_init(struct platform_device *dsidev)
> @@ -5480,14 +5511,17 @@ static int dsi_bind(struct device *dev, struct
> device *master, void *data)
>
> dsi->module_id = d->id;
>
> - if (dsi->data->model == DSI_MODEL_OMAP4) {
> + if (dsi->data->model == DSI_MODEL_OMAP4 ||
> + dsi->data->model == DSI_MODEL_OMAP5) {
> struct device_node *np;
>
> /*
> - * The OMAP4 display DT bindings don't reference the padconf
> + * The OMAP4/5 display DT bindings don't reference the padconf
> * syscon. Our only option to retrieve it is to find it by
name.
> */
> - np = of_find_node_by_name(NULL, "omap4_padconf_global");
> + np = of_find_node_by_name(NULL,
> + dsi->data->model == DSI_MODEL_OMAP4 ?
> + "omap4_padconf_global" : "omap5_padconf_global");
> if (!np)
> return -ENODEV;
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads
2017-08-10 6:45 [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
2017-08-10 7:22 ` Laurent Pinchart
2017-08-10 9:44 ` [PATCHv2] " Tomi Valkeinen
@ 2017-08-10 12:29 ` Tomi Valkeinen
2017-08-10 12:29 ` [PATCHv3 2/2] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
2017-08-10 13:22 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Laurent Pinchart
2 siblings, 2 replies; 9+ messages in thread
From: Tomi Valkeinen @ 2017-08-10 12:29 UTC (permalink / raw)
To: dri-devel, Laurent Pinchart
Cc: H . Nikolaus Schaller, Tomi Valkeinen, linux-omap
Use regmap_update_bits instead of regmap_read/write, which simplifies
the code.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/gpu/drm/omapdrm/dss/dsi.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index a66d2b1a6c74..1855d69b211d 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -2107,7 +2107,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
{
u32 enable_mask, enable_shift;
u32 pipd_mask, pipd_shift;
- u32 reg;
if (!dsi->syscon)
return 0;
@@ -2126,17 +2125,9 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
return -ENODEV;
}
- regmap_read(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®);
-
- reg &= ~enable_mask;
- reg &= ~pipd_mask;
-
- reg |= (lanes << enable_shift) & enable_mask;
- reg |= (lanes << pipd_shift) & pipd_mask;
-
- regmap_write(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg);
-
- return 0;
+ return regmap_update_bits(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET,
+ enable_mask | pipd_mask,
+ (lanes << enable_shift) | (lanes << pipd_shift));
}
static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
--
2.7.4
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCHv3 2/2] drm/omap: add OMAP5 DSIPHY lane-enable support
2017-08-10 12:29 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Tomi Valkeinen
@ 2017-08-10 12:29 ` Tomi Valkeinen
2017-08-10 13:23 ` Laurent Pinchart
2017-08-10 13:22 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Laurent Pinchart
1 sibling, 1 reply; 9+ messages in thread
From: Tomi Valkeinen @ 2017-08-10 12:29 UTC (permalink / raw)
To: dri-devel, Laurent Pinchart
Cc: H . Nikolaus Schaller, Tomi Valkeinen, linux-omap
We are missing OMAP5 DSIPHY lane-enable support, which has prevented
OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
to the recently added OMAP4 version.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/gpu/drm/omapdrm/dss/dsi.c | 47 ++++++++++++++++++++++++++++++++-------
1 file changed, 39 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 1855d69b211d..b56a05730314 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -2108,9 +2108,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
u32 enable_mask, enable_shift;
u32 pipd_mask, pipd_shift;
- if (!dsi->syscon)
- return 0;
-
if (dsi->module_id == 0) {
enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
@@ -2130,14 +2127,45 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
(lanes << enable_shift) | (lanes << pipd_shift));
}
+/* OMAP5 CONTROL_DSIPHY */
+
+#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
+
+#define OMAP5_DSI1_LANEENABLE_SHIFT 24
+#define OMAP5_DSI2_LANEENABLE_SHIFT 19
+#define OMAP5_DSI_LANEENABLE_MASK 0x1f
+
+static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
+{
+ u32 enable_shift;
+
+ if (dsi->module_id == 0)
+ enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
+ else if (dsi->module_id == 1)
+ enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
+ else
+ return -ENODEV;
+
+ return regmap_update_bits(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET,
+ OMAP5_DSI_LANEENABLE_MASK << enable_shift,
+ lanes << enable_shift);
+}
+
static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
{
- return dsi_omap4_mux_pads(dsi, lane_mask);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ return dsi_omap4_mux_pads(dsi, lane_mask);
+ if (dsi->data->model == DSI_MODEL_OMAP5)
+ return dsi_omap5_mux_pads(dsi, lane_mask);
+ return 0;
}
static void dsi_disable_pads(struct dsi_data *dsi)
{
- dsi_omap4_mux_pads(dsi, 0);
+ if (dsi->data->model == DSI_MODEL_OMAP4)
+ dsi_omap4_mux_pads(dsi, 0);
+ else if (dsi->data->model == DSI_MODEL_OMAP5)
+ dsi_omap5_mux_pads(dsi, 0);
}
static int dsi_cio_init(struct platform_device *dsidev)
@@ -5471,14 +5499,17 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
dsi->module_id = d->id;
- if (dsi->data->model == DSI_MODEL_OMAP4) {
+ if (dsi->data->model == DSI_MODEL_OMAP4 ||
+ dsi->data->model == DSI_MODEL_OMAP5) {
struct device_node *np;
/*
- * The OMAP4 display DT bindings don't reference the padconf
+ * The OMAP4/5 display DT bindings don't reference the padconf
* syscon. Our only option to retrieve it is to find it by name.
*/
- np = of_find_node_by_name(NULL, "omap4_padconf_global");
+ np = of_find_node_by_name(NULL,
+ dsi->data->model == DSI_MODEL_OMAP4 ?
+ "omap4_padconf_global" : "omap5_padconf_global");
if (!np)
return -ENODEV;
--
2.7.4
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads
2017-08-10 12:29 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Tomi Valkeinen
2017-08-10 12:29 ` [PATCHv3 2/2] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
@ 2017-08-10 13:22 ` Laurent Pinchart
1 sibling, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2017-08-10 13:22 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: H . Nikolaus Schaller, linux-omap, dri-devel
Hi Tomi,
Thank you for the patch.
On Thursday 10 Aug 2017 15:29:44 Tomi Valkeinen wrote:
> Use regmap_update_bits instead of regmap_read/write, which simplifies
> the code.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/omapdrm/dss/dsi.c | 15 +++------------
> 1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c
> b/drivers/gpu/drm/omapdrm/dss/dsi.c index a66d2b1a6c74..1855d69b211d 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -2107,7 +2107,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) {
> u32 enable_mask, enable_shift;
> u32 pipd_mask, pipd_shift;
> - u32 reg;
>
> if (!dsi->syscon)
> return 0;
> @@ -2126,17 +2125,9 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) return -ENODEV;
> }
>
> - regmap_read(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®);
> -
> - reg &= ~enable_mask;
> - reg &= ~pipd_mask;
> -
> - reg |= (lanes << enable_shift) & enable_mask;
> - reg |= (lanes << pipd_shift) & pipd_mask;
> -
> - regmap_write(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg);
> -
> - return 0;
> + return regmap_update_bits(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET,
> + enable_mask | pipd_mask,
> + (lanes << enable_shift) | (lanes << pipd_shift));
> }
>
> static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCHv3 2/2] drm/omap: add OMAP5 DSIPHY lane-enable support
2017-08-10 12:29 ` [PATCHv3 2/2] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
@ 2017-08-10 13:23 ` Laurent Pinchart
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2017-08-10 13:23 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: H . Nikolaus Schaller, linux-omap, dri-devel
Hi Tomi,
Thank you for the patch.
On Thursday 10 Aug 2017 15:29:45 Tomi Valkeinen wrote:
> We are missing OMAP5 DSIPHY lane-enable support, which has prevented
> OMAP5 DSI working in mainline. This patch adds the lane-enable similarly
> to the recently added OMAP4 version.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/omapdrm/dss/dsi.c | 47 +++++++++++++++++++++++++++++-------
> 1 file changed, 39 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c
> b/drivers/gpu/drm/omapdrm/dss/dsi.c index 1855d69b211d..b56a05730314 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -2108,9 +2108,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) u32 enable_mask, enable_shift;
> u32 pipd_mask, pipd_shift;
>
> - if (!dsi->syscon)
> - return 0;
> -
> if (dsi->module_id == 0) {
> enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
> enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
> @@ -2130,14 +2127,45 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi,
> unsigned int lanes) (lanes << enable_shift) | (lanes << pipd_shift));
> }
>
> +/* OMAP5 CONTROL_DSIPHY */
> +
> +#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
> +
> +#define OMAP5_DSI1_LANEENABLE_SHIFT 24
> +#define OMAP5_DSI2_LANEENABLE_SHIFT 19
> +#define OMAP5_DSI_LANEENABLE_MASK 0x1f
> +
> +static int dsi_omap5_mux_pads(struct dsi_data *dsi, unsigned int lanes)
> +{
> + u32 enable_shift;
> +
> + if (dsi->module_id == 0)
> + enable_shift = OMAP5_DSI1_LANEENABLE_SHIFT;
> + else if (dsi->module_id == 1)
> + enable_shift = OMAP5_DSI2_LANEENABLE_SHIFT;
> + else
> + return -ENODEV;
> +
> + return regmap_update_bits(dsi->syscon, OMAP5_DSIPHY_SYSCON_OFFSET,
> + OMAP5_DSI_LANEENABLE_MASK << enable_shift,
> + lanes << enable_shift);
> +}
> +
> static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
> {
> - return dsi_omap4_mux_pads(dsi, lane_mask);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
> + return dsi_omap4_mux_pads(dsi, lane_mask);
> + if (dsi->data->model == DSI_MODEL_OMAP5)
> + return dsi_omap5_mux_pads(dsi, lane_mask);
> + return 0;
> }
>
> static void dsi_disable_pads(struct dsi_data *dsi)
> {
> - dsi_omap4_mux_pads(dsi, 0);
> + if (dsi->data->model == DSI_MODEL_OMAP4)
> + dsi_omap4_mux_pads(dsi, 0);
> + else if (dsi->data->model == DSI_MODEL_OMAP5)
> + dsi_omap5_mux_pads(dsi, 0);
> }
>
> static int dsi_cio_init(struct platform_device *dsidev)
> @@ -5471,14 +5499,17 @@ static int dsi_bind(struct device *dev, struct
> device *master, void *data)
>
> dsi->module_id = d->id;
>
> - if (dsi->data->model == DSI_MODEL_OMAP4) {
> + if (dsi->data->model == DSI_MODEL_OMAP4 ||
> + dsi->data->model == DSI_MODEL_OMAP5) {
> struct device_node *np;
>
> /*
> - * The OMAP4 display DT bindings don't reference the padconf
> + * The OMAP4/5 display DT bindings don't reference the padconf
> * syscon. Our only option to retrieve it is to find it by
name.
> */
> - np = of_find_node_by_name(NULL, "omap4_padconf_global");
> + np = of_find_node_by_name(NULL,
> + dsi->data->model == DSI_MODEL_OMAP4 ?
> + "omap4_padconf_global" : "omap5_padconf_global");
> if (!np)
> return -ENODEV;
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-08-10 13:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 6:45 [PATCH] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
2017-08-10 7:22 ` Laurent Pinchart
2017-08-10 8:28 ` Tomi Valkeinen
2017-08-10 9:44 ` [PATCHv2] " Tomi Valkeinen
2017-08-10 10:31 ` Laurent Pinchart
2017-08-10 12:29 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Tomi Valkeinen
2017-08-10 12:29 ` [PATCHv3 2/2] drm/omap: add OMAP5 DSIPHY lane-enable support Tomi Valkeinen
2017-08-10 13:23 ` Laurent Pinchart
2017-08-10 13:22 ` [PATCHv3 1/2] drm/omap: use regmap_update_bit() when muxing DSI pads Laurent Pinchart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox