diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-05-08 00:06:54 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-05-13 09:07:58 -0400 |
commit | 3f521abd6cf1320d65a49cf9fc327b82168b5ba0 (patch) | |
tree | 48ba7da8ece88a7bbdb6286e3126ca3982932cc7 /drivers/video/sh_mobile_hdmi.c | |
parent | 66685aa00bf9970be8be3783dbc3b59f69968214 (diff) |
fbdev: sh_mobile_hdmi: add hdmi_bit_set() function
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/sh_mobile_hdmi.c')
-rw-r--r-- | drivers/video/sh_mobile_hdmi.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index eafb19da2c07..e201d6fea2d6 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
@@ -236,6 +236,16 @@ static u8 hdmi_read(struct sh_hdmi *hdmi, u8 reg) | |||
236 | return ioread8(hdmi->base + reg); | 236 | return ioread8(hdmi->base + reg); |
237 | } | 237 | } |
238 | 238 | ||
239 | static void hdmi_bit_set(struct sh_hdmi *hdmi, u8 mask, u8 data, u8 reg) | ||
240 | { | ||
241 | u8 val = hdmi_read(hdmi, reg); | ||
242 | |||
243 | val &= ~mask; | ||
244 | val |= (data & mask); | ||
245 | |||
246 | hdmi_write(hdmi, val, reg); | ||
247 | } | ||
248 | |||
239 | /* | 249 | /* |
240 | * HDMI sound | 250 | * HDMI sound |
241 | */ | 251 | */ |
@@ -693,11 +703,11 @@ static void sh_hdmi_configure(struct sh_hdmi *hdmi) | |||
693 | msleep(10); | 703 | msleep(10); |
694 | 704 | ||
695 | /* PS mode b->d, reset PLLA and PLLB */ | 705 | /* PS mode b->d, reset PLLA and PLLB */ |
696 | hdmi_write(hdmi, 0x4C, HDMI_SYSTEM_CTRL); | 706 | hdmi_bit_set(hdmi, 0xFC, 0x4C, HDMI_SYSTEM_CTRL); |
697 | 707 | ||
698 | udelay(10); | 708 | udelay(10); |
699 | 709 | ||
700 | hdmi_write(hdmi, 0x40, HDMI_SYSTEM_CTRL); | 710 | hdmi_bit_set(hdmi, 0xFC, 0x40, HDMI_SYSTEM_CTRL); |
701 | } | 711 | } |
702 | 712 | ||
703 | static unsigned long sh_hdmi_rate_error(struct sh_hdmi *hdmi, | 713 | static unsigned long sh_hdmi_rate_error(struct sh_hdmi *hdmi, |
@@ -917,13 +927,13 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id) | |||
917 | u8 status1, status2, mask1, mask2; | 927 | u8 status1, status2, mask1, mask2; |
918 | 928 | ||
919 | /* mode_b and PLLA and PLLB reset */ | 929 | /* mode_b and PLLA and PLLB reset */ |
920 | hdmi_write(hdmi, 0x2C, HDMI_SYSTEM_CTRL); | 930 | hdmi_bit_set(hdmi, 0xFC, 0x2C, HDMI_SYSTEM_CTRL); |
921 | 931 | ||
922 | /* How long shall reset be held? */ | 932 | /* How long shall reset be held? */ |
923 | udelay(10); | 933 | udelay(10); |
924 | 934 | ||
925 | /* mode_b and PLLA and PLLB reset release */ | 935 | /* mode_b and PLLA and PLLB reset release */ |
926 | hdmi_write(hdmi, 0x20, HDMI_SYSTEM_CTRL); | 936 | hdmi_bit_set(hdmi, 0xFC, 0x20, HDMI_SYSTEM_CTRL); |
927 | 937 | ||
928 | status1 = hdmi_read(hdmi, HDMI_INTERRUPT_STATUS_1); | 938 | status1 = hdmi_read(hdmi, HDMI_INTERRUPT_STATUS_1); |
929 | status2 = hdmi_read(hdmi, HDMI_INTERRUPT_STATUS_2); | 939 | status2 = hdmi_read(hdmi, HDMI_INTERRUPT_STATUS_2); |
@@ -1001,7 +1011,7 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity) | |||
1001 | */ | 1011 | */ |
1002 | if (hdmi->hp_state == HDMI_HOTPLUG_EDID_DONE) { | 1012 | if (hdmi->hp_state == HDMI_HOTPLUG_EDID_DONE) { |
1003 | /* PS mode d->e. All functions are active */ | 1013 | /* PS mode d->e. All functions are active */ |
1004 | hdmi_write(hdmi, 0x80, HDMI_SYSTEM_CTRL); | 1014 | hdmi_bit_set(hdmi, 0xFC, 0x80, HDMI_SYSTEM_CTRL); |
1005 | dev_dbg(hdmi->dev, "HDMI running\n"); | 1015 | dev_dbg(hdmi->dev, "HDMI running\n"); |
1006 | } | 1016 | } |
1007 | 1017 | ||
@@ -1016,7 +1026,7 @@ static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity) | |||
1016 | 1026 | ||
1017 | dev_dbg(hdmi->dev, "%s(%p)\n", __func__, hdmi); | 1027 | dev_dbg(hdmi->dev, "%s(%p)\n", __func__, hdmi); |
1018 | /* PS mode e->a */ | 1028 | /* PS mode e->a */ |
1019 | hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL); | 1029 | hdmi_bit_set(hdmi, 0xFC, 0x10, HDMI_SYSTEM_CTRL); |
1020 | } | 1030 | } |
1021 | 1031 | ||
1022 | static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = { | 1032 | static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = { |