@@ -21,6 +21,7 @@ struct lvds_codec {
21
21
struct device * dev ;
22
22
struct drm_bridge bridge ;
23
23
struct drm_bridge * panel_bridge ;
24
+ struct drm_bridge_timings timings ;
24
25
struct regulator * vcc ;
25
26
struct gpio_desc * powerdown_gpio ;
26
27
u32 connector_type ;
@@ -119,6 +120,7 @@ static int lvds_codec_probe(struct platform_device *pdev)
119
120
struct device_node * bus_node ;
120
121
struct drm_panel * panel ;
121
122
struct lvds_codec * lvds_codec ;
123
+ u32 val ;
122
124
int ret ;
123
125
124
126
lvds_codec = devm_kzalloc (dev , sizeof (* lvds_codec ), GFP_KERNEL );
@@ -187,12 +189,25 @@ static int lvds_codec_probe(struct platform_device *pdev)
187
189
}
188
190
}
189
191
192
+ /*
193
+ * Encoder might sample data on different clock edge than the display,
194
+ * for example OnSemi FIN3385 has a dedicated strapping pin to select
195
+ * the sampling edge.
196
+ */
197
+ if (lvds_codec -> connector_type == DRM_MODE_CONNECTOR_LVDS &&
198
+ !of_property_read_u32 (dev -> of_node , "pclk-sample" , & val )) {
199
+ lvds_codec -> timings .input_bus_flags = val ?
200
+ DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :
201
+ DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE ;
202
+ }
203
+
190
204
/*
191
205
* The panel_bridge bridge is attached to the panel's of_node,
192
206
* but we need a bridge attached to our of_node for our user
193
207
* to look up.
194
208
*/
195
209
lvds_codec -> bridge .of_node = dev -> of_node ;
210
+ lvds_codec -> bridge .timings = & lvds_codec -> timings ;
196
211
drm_bridge_add (& lvds_codec -> bridge );
197
212
198
213
platform_set_drvdata (pdev , lvds_codec );
0 commit comments