aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-09-11 12:27:50 -0400
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-12 17:40:47 -0400
commitdb85905ad95b090941dc894b7f93f9f3818bdc07 (patch)
treef6ddd1ad575c0d2fa66792002f9c6df1a6fe187f /drivers
parentd2c594a014563175b54115d1a73b607aaeb650ec (diff)
fbdev: sh_mobile_hdmi: Don't hook up into board_cfg display operations
The display_on/off operations are now accessed through the sh_mobile_lcdc_entity operations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/sh_mobile_hdmi.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index 5e5f83c31594..3f4e4a4c1cd8 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -1004,8 +1004,8 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id)
1004} 1004}
1005 1005
1006/* locking: called with info->lock held, or before register_framebuffer() */ 1006/* locking: called with info->lock held, or before register_framebuffer() */
1007static int __sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity, 1007static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
1008 struct fb_info *info) 1008 struct fb_info *info)
1009{ 1009{
1010 /* 1010 /*
1011 * info is guaranteed to be valid, when we are called, because our 1011 * info is guaranteed to be valid, when we are called, because our
@@ -1040,13 +1040,8 @@ static int __sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity,
1040 return 0; 1040 return 0;
1041} 1041}
1042 1042
1043static void sh_hdmi_display_on(void *arg, struct fb_info *info)
1044{
1045 __sh_hdmi_display_on(arg, info);
1046}
1047
1048/* locking: called with info->lock held */ 1043/* locking: called with info->lock held */
1049static void __sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity) 1044static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
1050{ 1045{
1051 struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity); 1046 struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
1052 1047
@@ -1055,14 +1050,9 @@ static void __sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
1055 hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL); 1050 hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL);
1056} 1051}
1057 1052
1058static void sh_hdmi_display_off(void *arg)
1059{
1060 __sh_hdmi_display_off(arg);
1061}
1062
1063static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = { 1053static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = {
1064 .display_on = __sh_hdmi_display_on, 1054 .display_on = sh_hdmi_display_on,
1065 .display_off = __sh_hdmi_display_off, 1055 .display_off = sh_hdmi_display_off,
1066}; 1056};
1067 1057
1068static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi) 1058static bool sh_hdmi_must_reconfigure(struct sh_hdmi *hdmi)
@@ -1178,7 +1168,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
1178 */ 1168 */
1179 info->var.width = hdmi->var.width; 1169 info->var.width = hdmi->var.width;
1180 info->var.height = hdmi->var.height; 1170 info->var.height = hdmi->var.height;
1181 __sh_hdmi_display_on(&hdmi->entity, info); 1171 sh_hdmi_display_on(&hdmi->entity, info);
1182 } else { 1172 } else {
1183 /* New monitor or have to wake up */ 1173 /* New monitor or have to wake up */
1184 fb_set_suspend(info, 0); 1174 fb_set_suspend(info, 0);
@@ -1255,7 +1245,6 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
1255{ 1245{
1256 struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data; 1246 struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data;
1257 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1247 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1258 struct sh_mobile_lcdc_board_cfg *board_cfg;
1259 int irq = platform_get_irq(pdev, 0), ret; 1248 int irq = platform_get_irq(pdev, 0), ret;
1260 struct sh_hdmi *hdmi; 1249 struct sh_hdmi *hdmi;
1261 long rate; 1250 long rate;
@@ -1315,13 +1304,6 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
1315 1304
1316 platform_set_drvdata(pdev, &hdmi->entity); 1305 platform_set_drvdata(pdev, &hdmi->entity);
1317 1306
1318 /* Set up LCDC callbacks */
1319 board_cfg = &pdata->lcd_chan->board_cfg;
1320 board_cfg->owner = THIS_MODULE;
1321 board_cfg->board_data = &hdmi->entity;
1322 board_cfg->display_on = sh_hdmi_display_on;
1323 board_cfg->display_off = sh_hdmi_display_off;
1324
1325 INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn); 1307 INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn);
1326 1308
1327 pm_runtime_enable(&pdev->dev); 1309 pm_runtime_enable(&pdev->dev);
@@ -1371,21 +1353,14 @@ egetclk:
1371 1353
1372static int __exit sh_hdmi_remove(struct platform_device *pdev) 1354static int __exit sh_hdmi_remove(struct platform_device *pdev)
1373{ 1355{
1374 struct sh_mobile_hdmi_info *pdata = pdev->dev.platform_data;
1375 struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev)); 1356 struct sh_hdmi *hdmi = entity_to_sh_hdmi(platform_get_drvdata(pdev));
1376 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1357 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1377 struct sh_mobile_lcdc_board_cfg *board_cfg = &pdata->lcd_chan->board_cfg;
1378 int irq = platform_get_irq(pdev, 0); 1358 int irq = platform_get_irq(pdev, 0);
1379 1359
1380 snd_soc_unregister_codec(&pdev->dev); 1360 snd_soc_unregister_codec(&pdev->dev);
1381 1361
1382 fb_unregister_client(&hdmi->notifier); 1362 fb_unregister_client(&hdmi->notifier);
1383 1363
1384 board_cfg->display_on = NULL;
1385 board_cfg->display_off = NULL;
1386 board_cfg->board_data = NULL;
1387 board_cfg->owner = NULL;
1388
1389 /* No new work will be scheduled, wait for running ISR */ 1364 /* No new work will be scheduled, wait for running ISR */
1390 free_irq(irq, hdmi); 1365 free_irq(irq, hdmi);
1391 /* Wait for already scheduled work */ 1366 /* Wait for already scheduled work */