diff mbox series

drm/bridge: tfp410: add pclk limits

Message ID 20200113134528.9851-1-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show
Series drm/bridge: tfp410: add pclk limits | expand

Commit Message

Tomi Valkeinen Jan. 13, 2020, 1:45 p.m. UTC
Add pixel clock limits to the driver as per TFP410 datasheet: min 25MHz,
max 165MHz.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/bridge/ti-tfp410.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Andrzej Hajda Jan. 17, 2020, 10:05 a.m. UTC | #1
On 13.01.2020 14:45, Tomi Valkeinen wrote:
> Add pixel clock limits to the driver as per TFP410 datasheet: min 25MHz,
> max 165MHz.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej

> ---
>  drivers/gpu/drm/bridge/ti-tfp410.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
> index 6f6d6d1e60ae..f378a8f79bcb 100644
> --- a/drivers/gpu/drm/bridge/ti-tfp410.c
> +++ b/drivers/gpu/drm/bridge/ti-tfp410.c
> @@ -167,10 +167,20 @@ static void tfp410_disable(struct drm_bridge *bridge)
>  	gpiod_set_value_cansleep(dvi->powerdown, 1);
>  }
>  
> +static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge,
> +					      const struct drm_display_mode *mode)
> +{
> +	if (mode->clock < 25000 || mode->clock > 165000)
> +		return MODE_BAD;
> +
> +	return MODE_OK;
> +}
> +
>  static const struct drm_bridge_funcs tfp410_bridge_funcs = {
>  	.attach		= tfp410_attach,
>  	.enable		= tfp410_enable,
>  	.disable	= tfp410_disable,
> +	.mode_valid	= tfp410_mode_valid,
>  };
>  
>  static void tfp410_hpd_work_func(struct work_struct *work)
Laurent Pinchart Jan. 17, 2020, 12:53 p.m. UTC | #2
Hi Tomi,

Thank you for the patch.

On Mon, Jan 13, 2020 at 03:45:28PM +0200, Tomi Valkeinen wrote:
> Add pixel clock limits to the driver as per TFP410 datasheet: min 25MHz,
> max 165MHz.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/bridge/ti-tfp410.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
> index 6f6d6d1e60ae..f378a8f79bcb 100644
> --- a/drivers/gpu/drm/bridge/ti-tfp410.c
> +++ b/drivers/gpu/drm/bridge/ti-tfp410.c
> @@ -167,10 +167,20 @@ static void tfp410_disable(struct drm_bridge *bridge)
>  	gpiod_set_value_cansleep(dvi->powerdown, 1);
>  }
>  
> +static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge,
> +					      const struct drm_display_mode *mode)
> +{
> +	if (mode->clock < 25000 || mode->clock > 165000)
> +		return MODE_BAD;

Shouldn't you return MODE_CLOCK_LOW AND MODE_CLOCK_HIGH respectively ?
Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
> +	return MODE_OK;
> +}
> +
>  static const struct drm_bridge_funcs tfp410_bridge_funcs = {
>  	.attach		= tfp410_attach,
>  	.enable		= tfp410_enable,
>  	.disable	= tfp410_disable,
> +	.mode_valid	= tfp410_mode_valid,
>  };
>  
>  static void tfp410_hpd_work_func(struct work_struct *work)
Tomi Valkeinen Jan. 21, 2020, 9:44 a.m. UTC | #3
On 17/01/2020 14:53, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Mon, Jan 13, 2020 at 03:45:28PM +0200, Tomi Valkeinen wrote:
>> Add pixel clock limits to the driver as per TFP410 datasheet: min 25MHz,
>> max 165MHz.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>   drivers/gpu/drm/bridge/ti-tfp410.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
>> index 6f6d6d1e60ae..f378a8f79bcb 100644
>> --- a/drivers/gpu/drm/bridge/ti-tfp410.c
>> +++ b/drivers/gpu/drm/bridge/ti-tfp410.c
>> @@ -167,10 +167,20 @@ static void tfp410_disable(struct drm_bridge *bridge)
>>   	gpiod_set_value_cansleep(dvi->powerdown, 1);
>>   }
>>   
>> +static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge,
>> +					      const struct drm_display_mode *mode)
>> +{
>> +	if (mode->clock < 25000 || mode->clock > 165000)
>> +		return MODE_BAD;
> 
> Shouldn't you return MODE_CLOCK_LOW AND MODE_CLOCK_HIGH respectively ?
> Apart from that,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Indeed. I'll send a v2. Thanks!

  Tomi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
index 6f6d6d1e60ae..f378a8f79bcb 100644
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
@@ -167,10 +167,20 @@  static void tfp410_disable(struct drm_bridge *bridge)
 	gpiod_set_value_cansleep(dvi->powerdown, 1);
 }
 
+static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge,
+					      const struct drm_display_mode *mode)
+{
+	if (mode->clock < 25000 || mode->clock > 165000)
+		return MODE_BAD;
+
+	return MODE_OK;
+}
+
 static const struct drm_bridge_funcs tfp410_bridge_funcs = {
 	.attach		= tfp410_attach,
 	.enable		= tfp410_enable,
 	.disable	= tfp410_disable,
+	.mode_valid	= tfp410_mode_valid,
 };
 
 static void tfp410_hpd_work_func(struct work_struct *work)