diff options
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 5 | ||||
-rw-r--r-- | drivers/video/sh_mobile_meram.c | 32 | ||||
-rw-r--r-- | include/video/sh_mobile_meram.h | 15 |
3 files changed, 14 insertions, 38 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 4b54cd5c9564..7a0b301587f6 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -1072,14 +1072,11 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var, | |||
1072 | 1072 | ||
1073 | if (ch->meram) { | 1073 | if (ch->meram) { |
1074 | struct sh_mobile_meram_info *mdev; | 1074 | struct sh_mobile_meram_info *mdev; |
1075 | int ret; | ||
1076 | 1075 | ||
1077 | mdev = priv->meram_dev; | 1076 | mdev = priv->meram_dev; |
1078 | ret = mdev->ops->meram_update(mdev, ch->meram, | 1077 | mdev->ops->meram_update(mdev, ch->meram, |
1079 | base_addr_y, base_addr_c, | 1078 | base_addr_y, base_addr_c, |
1080 | &base_addr_y, &base_addr_c); | 1079 | &base_addr_y, &base_addr_c); |
1081 | if (ret) | ||
1082 | return ret; | ||
1083 | } | 1080 | } |
1084 | 1081 | ||
1085 | ch->base_addr_y = base_addr_y; | 1082 | ch->base_addr_y = base_addr_y; |
diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c index 2ce0d8f72e31..d9f7a44c231c 100644 --- a/drivers/video/sh_mobile_meram.c +++ b/drivers/video/sh_mobile_meram.c | |||
@@ -451,21 +451,15 @@ static void *sh_mobile_meram_register(struct sh_mobile_meram_info *pdata, | |||
451 | unsigned int *pitch) | 451 | unsigned int *pitch) |
452 | { | 452 | { |
453 | struct sh_mobile_meram_fb_cache *cache; | 453 | struct sh_mobile_meram_fb_cache *cache; |
454 | struct sh_mobile_meram_priv *priv; | 454 | struct sh_mobile_meram_priv *priv = pdata->priv; |
455 | struct platform_device *pdev; | 455 | struct platform_device *pdev = pdata->pdev; |
456 | unsigned int out_pitch; | 456 | unsigned int out_pitch; |
457 | 457 | ||
458 | if (!pdata || !pdata->priv || !pdata->pdev || !cfg) | ||
459 | return ERR_PTR(-EINVAL); | ||
460 | |||
461 | if (pixelformat != SH_MOBILE_MERAM_PF_NV && | 458 | if (pixelformat != SH_MOBILE_MERAM_PF_NV && |
462 | pixelformat != SH_MOBILE_MERAM_PF_NV24 && | 459 | pixelformat != SH_MOBILE_MERAM_PF_NV24 && |
463 | pixelformat != SH_MOBILE_MERAM_PF_RGB) | 460 | pixelformat != SH_MOBILE_MERAM_PF_RGB) |
464 | return ERR_PTR(-EINVAL); | 461 | return ERR_PTR(-EINVAL); |
465 | 462 | ||
466 | priv = pdata->priv; | ||
467 | pdev = pdata->pdev; | ||
468 | |||
469 | dev_dbg(&pdev->dev, "registering %dx%d (%s)", xres, yres, | 463 | dev_dbg(&pdev->dev, "registering %dx%d (%s)", xres, yres, |
470 | !pixelformat ? "yuv" : "rgb"); | 464 | !pixelformat ? "yuv" : "rgb"); |
471 | 465 | ||
@@ -500,16 +494,11 @@ err: | |||
500 | return cache; | 494 | return cache; |
501 | } | 495 | } |
502 | 496 | ||
503 | static int | 497 | static void |
504 | sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data) | 498 | sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data) |
505 | { | 499 | { |
506 | struct sh_mobile_meram_fb_cache *cache = data; | 500 | struct sh_mobile_meram_fb_cache *cache = data; |
507 | struct sh_mobile_meram_priv *priv; | 501 | struct sh_mobile_meram_priv *priv = pdata->priv; |
508 | |||
509 | if (!pdata || !pdata->priv || !data) | ||
510 | return -EINVAL; | ||
511 | |||
512 | priv = pdata->priv; | ||
513 | 502 | ||
514 | mutex_lock(&priv->lock); | 503 | mutex_lock(&priv->lock); |
515 | 504 | ||
@@ -521,22 +510,15 @@ sh_mobile_meram_unregister(struct sh_mobile_meram_info *pdata, void *data) | |||
521 | meram_free(priv, cache); | 510 | meram_free(priv, cache); |
522 | 511 | ||
523 | mutex_unlock(&priv->lock); | 512 | mutex_unlock(&priv->lock); |
524 | |||
525 | return 0; | ||
526 | } | 513 | } |
527 | 514 | ||
528 | static int | 515 | static void |
529 | sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data, | 516 | sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data, |
530 | unsigned long base_addr_y, unsigned long base_addr_c, | 517 | unsigned long base_addr_y, unsigned long base_addr_c, |
531 | unsigned long *icb_addr_y, unsigned long *icb_addr_c) | 518 | unsigned long *icb_addr_y, unsigned long *icb_addr_c) |
532 | { | 519 | { |
533 | struct sh_mobile_meram_fb_cache *cache = data; | 520 | struct sh_mobile_meram_fb_cache *cache = data; |
534 | struct sh_mobile_meram_priv *priv; | 521 | struct sh_mobile_meram_priv *priv = pdata->priv; |
535 | |||
536 | if (!pdata || !pdata->priv || !data) | ||
537 | return -EINVAL; | ||
538 | |||
539 | priv = pdata->priv; | ||
540 | 522 | ||
541 | mutex_lock(&priv->lock); | 523 | mutex_lock(&priv->lock); |
542 | 524 | ||
@@ -544,8 +526,6 @@ sh_mobile_meram_update(struct sh_mobile_meram_info *pdata, void *data, | |||
544 | meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c); | 526 | meram_get_next_icb_addr(pdata, cache, icb_addr_y, icb_addr_c); |
545 | 527 | ||
546 | mutex_unlock(&priv->lock); | 528 | mutex_unlock(&priv->lock); |
547 | |||
548 | return 0; | ||
549 | } | 529 | } |
550 | 530 | ||
551 | static struct sh_mobile_meram_ops sh_mobile_meram_ops = { | 531 | static struct sh_mobile_meram_ops sh_mobile_meram_ops = { |
diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h index 553335ce7a2c..29b2fd3b147e 100644 --- a/include/video/sh_mobile_meram.h +++ b/include/video/sh_mobile_meram.h | |||
@@ -49,16 +49,15 @@ struct sh_mobile_meram_ops { | |||
49 | unsigned int *pitch); | 49 | unsigned int *pitch); |
50 | 50 | ||
51 | /* unregister usage of meram */ | 51 | /* unregister usage of meram */ |
52 | int (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, | 52 | void (*meram_unregister)(struct sh_mobile_meram_info *meram_dev, |
53 | void *data); | 53 | void *data); |
54 | 54 | ||
55 | /* update meram settings */ | 55 | /* update meram settings */ |
56 | int (*meram_update)(struct sh_mobile_meram_info *meram_dev, | 56 | void (*meram_update)(struct sh_mobile_meram_info *meram_dev, void *data, |
57 | void *data, | 57 | unsigned long base_addr_y, |
58 | unsigned long base_addr_y, | 58 | unsigned long base_addr_c, |
59 | unsigned long base_addr_c, | 59 | unsigned long *icb_addr_y, |
60 | unsigned long *icb_addr_y, | 60 | unsigned long *icb_addr_c); |
61 | unsigned long *icb_addr_c); | ||
62 | }; | 61 | }; |
63 | 62 | ||
64 | #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */ | 63 | #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */ |