*vm = ddata->vm;
}
-static int tvc_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops tvc_ops = {
.connect = tvc_connect,
.disconnect = tvc_disconnect,
.set_timings = tvc_set_timings,
.get_timings = tvc_get_timings,
- .check_timings = tvc_check_timings,
};
static int tvc_probe(struct platform_device *pdev)
*vm = ddata->vm;
}
-static int dvic_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static int dvic_ddc_read(struct i2c_adapter *adapter,
unsigned char *buf, u16 count, u8 offset)
{
.set_timings = dvic_set_timings,
.get_timings = dvic_get_timings,
- .check_timings = dvic_check_timings,
.read_edid = dvic_read_edid,
.detect = dvic_detect,
*vm = ddata->vm;
}
-static int hdmic_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static bool hdmic_detect(struct omap_dss_device *dssdev)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
.set_timings = hdmic_set_timings,
.get_timings = hdmic_get_timings,
- .check_timings = hdmic_check_timings,
.detect = hdmic_detect,
.register_hpd_cb = hdmic_register_hpd_cb,
src->ops->set_timings(src, vm);
}
-static int opa362_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- dev_dbg(dssdev->dev, "check_timings\n");
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops opa362_ops = {
.connect = opa362_connect,
.disconnect = opa362_disconnect,
.enable = opa362_enable,
.disable = opa362_disable,
- .check_timings = opa362_check_timings,
.set_timings = opa362_set_timings,
};
src->ops->set_timings(src, vm);
}
-static int tfp410_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops tfp410_ops = {
.connect = tfp410_connect,
.disconnect = tfp410_disconnect,
.enable = tfp410_enable,
.disable = tfp410_disable,
- .check_timings = tfp410_check_timings,
.set_timings = tfp410_set_timings,
};
src->ops->set_timings(src, vm);
}
-static int tpd_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static bool tpd_detect(struct omap_dss_device *dssdev)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
.disconnect = tpd_disconnect,
.enable = tpd_enable,
.disable = tpd_disable,
- .check_timings = tpd_check_timings,
.set_timings = tpd_set_timings,
.detect = tpd_detect,
.register_hpd_cb = tpd_register_hpd_cb,
*vm = ddata->vm;
}
-static int panel_dpi_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops panel_dpi_ops = {
.connect = panel_dpi_connect,
.disconnect = panel_dpi_disconnect,
.set_timings = panel_dpi_set_timings,
.get_timings = panel_dpi_get_timings,
- .check_timings = panel_dpi_check_timings,
};
static int panel_dpi_probe_of(struct platform_device *pdev)
*vm = ddata->vm;
}
-static int lb035q02_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops lb035q02_ops = {
.connect = lb035q02_connect,
.disconnect = lb035q02_disconnect,
.set_timings = lb035q02_set_timings,
.get_timings = lb035q02_get_timings,
- .check_timings = lb035q02_check_timings,
};
static int lb035q02_probe_of(struct spi_device *spi)
*vm = ddata->vm;
}
-static int nec_8048_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops nec_8048_ops = {
.connect = nec_8048_connect,
.disconnect = nec_8048_disconnect,
.set_timings = nec_8048_set_timings,
.get_timings = nec_8048_get_timings,
- .check_timings = nec_8048_check_timings,
};
static int nec_8048_probe(struct spi_device *spi)
*vm = ddata->vm;
}
-static int sharp_ls_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops sharp_ls_ops = {
.connect = sharp_ls_connect,
.disconnect = sharp_ls_disconnect,
.set_timings = sharp_ls_set_timings,
.get_timings = sharp_ls_get_timings,
- .check_timings = sharp_ls_check_timings,
};
static int sharp_ls_get_gpio_of(struct device *dev, int index, int val,
*vm = ddata->vm;
}
-static int acx565akm_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops acx565akm_ops = {
.connect = acx565akm_connect,
.disconnect = acx565akm_disconnect,
.set_timings = acx565akm_set_timings,
.get_timings = acx565akm_get_timings,
- .check_timings = acx565akm_check_timings,
};
static int acx565akm_probe(struct spi_device *spi)
*vm = ddata->vm;
}
-static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops td028ttec1_ops = {
.connect = td028ttec1_panel_connect,
.disconnect = td028ttec1_panel_disconnect,
.set_timings = td028ttec1_panel_set_timings,
.get_timings = td028ttec1_panel_get_timings,
- .check_timings = td028ttec1_panel_check_timings,
};
static int td028ttec1_panel_probe(struct spi_device *spi)
*vm = ddata->vm;
}
-static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
- struct videomode *vm)
-{
- struct omap_dss_device *src = dssdev->src;
-
- return src->ops->check_timings(src, vm);
-}
-
static const struct omap_dss_device_ops tpo_td043_ops = {
.connect = tpo_td043_connect,
.disconnect = tpo_td043_disconnect,
.set_timings = tpo_td043_set_timings,
.get_timings = tpo_td043_get_timings,
- .check_timings = tpo_td043_check_timings,
};
static int tpo_td043_probe(struct spi_device *spi)
struct drm_display_mode *mode)
{
struct omap_connector *omap_connector = to_omap_connector(connector);
- struct omap_dss_device *dssdev = omap_connector->display;
+ struct omap_dss_device *dssdev;
struct videomode vm = {0};
struct drm_device *dev = connector->dev;
struct drm_display_mode *new_mode;
drm_display_mode_to_videomode(mode, &vm);
mode->vrefresh = drm_mode_vrefresh(mode);
- r = dssdev->ops->check_timings(dssdev, &vm);
- if (!r) {
- /* check if vrefresh is still valid */
- new_mode = drm_mode_duplicate(dev, mode);
-
- if (!new_mode)
- return MODE_BAD;
+ for (dssdev = omap_connector->output; dssdev; dssdev = dssdev->next) {
+ if (!dssdev->ops->check_timings)
+ continue;
- new_mode->clock = vm.pixelclock / 1000;
- new_mode->vrefresh = 0;
- if (mode->vrefresh == drm_mode_vrefresh(new_mode))
- ret = MODE_OK;
- drm_mode_destroy(dev, new_mode);
+ r = dssdev->ops->check_timings(dssdev, &vm);
+ if (r)
+ goto done;
}
+ /* check if vrefresh is still valid */
+ new_mode = drm_mode_duplicate(dev, mode);
+ if (!new_mode)
+ return MODE_BAD;
+
+ new_mode->clock = vm.pixelclock / 1000;
+ new_mode->vrefresh = 0;
+ if (mode->vrefresh == drm_mode_vrefresh(new_mode))
+ ret = MODE_OK;
+ drm_mode_destroy(dev, new_mode);
+
+done:
DBG("connector: mode %s: "
"%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
(ret == MODE_OK) ? "valid" : "invalid",
{
struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
- struct omap_dss_device *dssdev = omap_encoder->display;
+ struct omap_dss_device *display = omap_encoder->display;
+ struct omap_dss_device *dssdev;
int ret;
- ret = dssdev->ops->check_timings(dssdev, vm);
- if (ret) {
- dev_err(dev->dev, "invalid timings: %d\n", ret);
- return ret;
+ for (dssdev = omap_encoder->output; dssdev; dssdev = dssdev->next) {
+ if (!dssdev->ops->check_timings)
+ continue;
+
+ ret = dssdev->ops->check_timings(dssdev, vm);
+ if (ret) {
+ dev_err(dev->dev, "invalid timings: %d\n", ret);
+ return ret;
+ }
}
- if (dssdev->ops->set_timings)
- dssdev->ops->set_timings(dssdev, vm);
+ if (display->ops->set_timings)
+ display->ops->set_timings(display, vm);
return 0;
}