[PATCH V2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

Marek Vasut marex at denx.de
Mon Mar 22 10:29:04 UTC 2021


On 3/22/21 2:14 AM, Laurent Pinchart wrote:
> Hi Marek,

Hi,

[...]

>> diff --git a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml
>> index e5e3c72630cf..399a6528780a 100644
>> --- a/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml
>> +++ b/Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml
>> @@ -74,6 +74,13 @@ properties:
>>   
>>       additionalProperties: false
>>   
>> +  pixelclk-active:
>> +    description: |
>> +      Data sampling on rising or falling edge.
>> +      Use 0 to sample pixel data on rising edge and
>> +      Use 1 to sample pixel data on falling edge and
>> +    enum: [0, 1]
> 
> The idea is good, but instead of adding a custom property, how about
> reusing the pclk-sample property defined in
> ../../media/video-interfaces.yaml ?

Repeating myself from V1 discussion ... Either is fine by me, but I 
think pixelclk-active, which comes from panel-timings.yaml is closer to 
the video than multimedia bindings.

> The property is only valid for encoders, so I would at least mention
> that in the description, or, better, handle this based on the compatible
> string to allow validation.

How does that work in the Yaml file ?

>> +
>>     powerdown-gpios:
>>       description:
>>         The GPIO used to control the power down line of this device.
>> diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c
>> index dcf579a4cf83..cab81ccd895d 100644
>> --- a/drivers/gpu/drm/bridge/lvds-codec.c
>> +++ b/drivers/gpu/drm/bridge/lvds-codec.c

[...]

>> @@ -126,6 +146,7 @@ static int lvds_codec_probe(struct platform_device *pdev)
>>   	 */
>>   	lvds_codec->bridge.of_node = dev->of_node;
>>   	lvds_codec->bridge.funcs = &funcs;
>> +	lvds_codec->bridge.timings = &lvds_codec->timings;
>>   	drm_bridge_add(&lvds_codec->bridge);
>>   
>>   	platform_set_drvdata(pdev, lvds_codec);
>> @@ -142,19 +163,20 @@ static int lvds_codec_remove(struct platform_device *pdev)
>>   	return 0;
>>   }
>>   
>> +static const struct lvds_codec_data decoder_data = {
>> +	.connector_type = DRM_MODE_CONNECTOR_DPI,
>> +	.is_encoder = false,
> 
> The two fields are a bit redundant, as the decoder is always
> LVDS-to-DPI, and the encoder DPI-to-LVDS. I don't mind too much, but
> maybe we could drop the connector_type field, and derive the connector
> type from is_encoder ?

Or the other way around instead ? That is, if the connector_type is 
LVDS, then it is encoder , otherwise its decoder ?

> One may then say that we could drop the lvds_codec_data structure as it
> contains a single field, but I foresee a need to have device-specific
> timings at some point, so I think it's a good addition.

[...]


More information about the dri-devel mailing list