提交 36511312 编写于 作者: T Tomi Valkeinen

OMAP: DSS2: move set/get_wss()

Move set/get_wss() from omap_dss_device to omap_dss_driver.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@nokia.com>
上级 37ac60e4
...@@ -469,9 +469,6 @@ struct omap_dss_device { ...@@ -469,9 +469,6 @@ struct omap_dss_device {
void (*get_timings)(struct omap_dss_device *dssdev, void (*get_timings)(struct omap_dss_device *dssdev,
struct omap_video_timings *timings); struct omap_video_timings *timings);
int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
u32 (*get_wss)(struct omap_dss_device *dssdev);
/* platform specific */ /* platform specific */
int (*platform_enable)(struct omap_dss_device *dssdev); int (*platform_enable)(struct omap_dss_device *dssdev);
void (*platform_disable)(struct omap_dss_device *dssdev); void (*platform_disable)(struct omap_dss_device *dssdev);
...@@ -516,6 +513,9 @@ struct omap_dss_driver { ...@@ -516,6 +513,9 @@ struct omap_dss_driver {
void (*get_resolution)(struct omap_dss_device *dssdev, void (*get_resolution)(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres); u16 *xres, u16 *yres);
int (*get_recommended_bpp)(struct omap_dss_device *dssdev); int (*get_recommended_bpp)(struct omap_dss_device *dssdev);
int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
u32 (*get_wss)(struct omap_dss_device *dssdev);
}; };
int omap_dss_register_driver(struct omap_dss_driver *); int omap_dss_register_driver(struct omap_dss_driver *);
......
...@@ -247,10 +247,10 @@ static ssize_t display_wss_show(struct device *dev, ...@@ -247,10 +247,10 @@ static ssize_t display_wss_show(struct device *dev,
struct omap_dss_device *dssdev = to_dss_device(dev); struct omap_dss_device *dssdev = to_dss_device(dev);
unsigned int wss; unsigned int wss;
if (!dssdev->get_wss) if (!dssdev->driver->get_wss)
return -ENOENT; return -ENOENT;
wss = dssdev->get_wss(dssdev); wss = dssdev->driver->get_wss(dssdev);
return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss); return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss);
} }
...@@ -262,7 +262,7 @@ static ssize_t display_wss_store(struct device *dev, ...@@ -262,7 +262,7 @@ static ssize_t display_wss_store(struct device *dev,
unsigned long wss; unsigned long wss;
int r; int r;
if (!dssdev->get_wss || !dssdev->set_wss) if (!dssdev->driver->get_wss || !dssdev->driver->set_wss)
return -ENOENT; return -ENOENT;
if (strict_strtoul(buf, 0, &wss)) if (strict_strtoul(buf, 0, &wss))
...@@ -271,7 +271,7 @@ static ssize_t display_wss_store(struct device *dev, ...@@ -271,7 +271,7 @@ static ssize_t display_wss_store(struct device *dev,
if (wss > 0xfffff) if (wss > 0xfffff)
return -EINVAL; return -EINVAL;
r = dssdev->set_wss(dssdev, wss); r = dssdev->driver->set_wss(dssdev, wss);
if (r) if (r)
return r; return r;
......
...@@ -557,6 +557,37 @@ static int venc_set_update_mode(struct omap_dss_device *dssdev, ...@@ -557,6 +557,37 @@ static int venc_set_update_mode(struct omap_dss_device *dssdev,
return 0; return 0;
} }
static u32 venc_get_wss(struct omap_dss_device *dssdev)
{
/* Invert due to VENC_L21_WC_CTL:INV=1 */
return (venc.wss_data >> 8) ^ 0xfffff;
}
static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
{
const struct venc_config *config;
DSSDBG("venc_set_wss\n");
mutex_lock(&venc.venc_lock);
config = venc_timings_to_config(&dssdev->panel.timings);
/* Invert due to VENC_L21_WC_CTL:INV=1 */
venc.wss_data = (wss ^ 0xfffff) << 8;
venc_enable_clocks(1);
venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
venc.wss_data);
venc_enable_clocks(0);
mutex_unlock(&venc.venc_lock);
return 0;
}
static struct omap_dss_driver venc_driver = { static struct omap_dss_driver venc_driver = {
.probe = venc_panel_probe, .probe = venc_panel_probe,
.remove = venc_panel_remove, .remove = venc_panel_remove,
...@@ -572,6 +603,9 @@ static struct omap_dss_driver venc_driver = { ...@@ -572,6 +603,9 @@ static struct omap_dss_driver venc_driver = {
.set_update_mode = venc_set_update_mode, .set_update_mode = venc_set_update_mode,
.get_update_mode = venc_get_update_mode, .get_update_mode = venc_get_update_mode,
.get_wss = venc_get_wss,
.set_wss = venc_set_wss,
.driver = { .driver = {
.name = "venc", .name = "venc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -656,37 +690,6 @@ static int venc_check_timings(struct omap_dss_device *dssdev, ...@@ -656,37 +690,6 @@ static int venc_check_timings(struct omap_dss_device *dssdev,
return -EINVAL; return -EINVAL;
} }
static u32 venc_get_wss(struct omap_dss_device *dssdev)
{
/* Invert due to VENC_L21_WC_CTL:INV=1 */
return (venc.wss_data >> 8) ^ 0xfffff;
}
static int venc_set_wss(struct omap_dss_device *dssdev, u32 wss)
{
const struct venc_config *config;
DSSDBG("venc_set_wss\n");
mutex_lock(&venc.venc_lock);
config = venc_timings_to_config(&dssdev->panel.timings);
/* Invert due to VENC_L21_WC_CTL:INV=1 */
venc.wss_data = (wss ^ 0xfffff) << 8;
venc_enable_clocks(1);
venc_write_reg(VENC_BSTAMP_WSS_DATA, config->bstamp_wss_data |
venc.wss_data);
venc_enable_clocks(0);
mutex_unlock(&venc.venc_lock);
return 0;
}
int venc_init_display(struct omap_dss_device *dssdev) int venc_init_display(struct omap_dss_device *dssdev)
{ {
DSSDBG("init_display\n"); DSSDBG("init_display\n");
...@@ -694,8 +697,6 @@ int venc_init_display(struct omap_dss_device *dssdev) ...@@ -694,8 +697,6 @@ int venc_init_display(struct omap_dss_device *dssdev)
dssdev->get_timings = venc_get_timings; dssdev->get_timings = venc_get_timings;
dssdev->set_timings = venc_set_timings; dssdev->set_timings = venc_set_timings;
dssdev->check_timings = venc_check_timings; dssdev->check_timings = venc_check_timings;
dssdev->get_wss = venc_get_wss;
dssdev->set_wss = venc_set_wss;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册