Hi Boris/Laurent.
- err = of_property_read_u32(np, "bus-width", &input_bus_width);
- of_node_put(np);
- if (err) {
lvds_codec->input_fmt = MEDIA_BUS_FMT_FIXED;
- } else if (input_bus_width == 18) {
lvds_codec->input_fmt = MEDIA_BUS_FMT_RGB666_1X18;
- } else if (input_bus_width == 24) {
lvds_codec->input_fmt = MEDIA_BUS_FMT_RGB888_1X24;
- } else {
dev_dbg(dev, "unsupported bus-width value %u on port 0\n",
input_bus_width);
return -ENOTSUPP;
ENOTSUPP is "Operation not supported", I'd go for -EINVAL.
- }
Doesn't this apply to LVDS encoders only ? For LVDS decoders I don't think we want to report an RGB format on the input.
In panel-lvds we use the property "data-mapping" for the same purpose. To specify the MEDIA_BUS format.
It would be good to standardize on the same property, and maybe have the same binding descriptions for all.
And "data-mapping" is a text string, which gives us more flexibility than just a number, that for MEDIA_BUS_FMT seems required.
Sam