• Home
  • Raw
  • Download

Lines Matching refs:ip_data

53 static inline void __iomem *hdmi_wp_base(struct hdmi_ip_data *ip_data)  in hdmi_wp_base()  argument
55 return ip_data->base_wp; in hdmi_wp_base()
58 static inline void __iomem *hdmi_phy_base(struct hdmi_ip_data *ip_data) in hdmi_phy_base() argument
60 return ip_data->base_wp + ip_data->phy_offset; in hdmi_phy_base()
63 static inline void __iomem *hdmi_pll_base(struct hdmi_ip_data *ip_data) in hdmi_pll_base() argument
65 return ip_data->base_wp + ip_data->pll_offset; in hdmi_pll_base()
68 static inline void __iomem *hdmi_av_base(struct hdmi_ip_data *ip_data) in hdmi_av_base() argument
70 return ip_data->base_wp + ip_data->core_av_offset; in hdmi_av_base()
73 static inline void __iomem *hdmi_core_sys_base(struct hdmi_ip_data *ip_data) in hdmi_core_sys_base() argument
75 return ip_data->base_wp + ip_data->core_sys_offset; in hdmi_core_sys_base()
91 static int hdmi_pll_init(struct hdmi_ip_data *ip_data) in hdmi_pll_init() argument
94 void __iomem *pll_base = hdmi_pll_base(ip_data); in hdmi_pll_init()
95 struct hdmi_pll_info *fmt = &ip_data->pll_data; in hdmi_pll_init()
158 static int hdmi_set_phy_pwr(struct hdmi_ip_data *ip_data, enum hdmi_phy_pwr val) in hdmi_set_phy_pwr() argument
161 if (REG_GET(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, 5, 4) == val) in hdmi_set_phy_pwr()
165 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, val, 7, 6); in hdmi_set_phy_pwr()
168 if (hdmi_wait_for_bit_change(hdmi_wp_base(ip_data), in hdmi_set_phy_pwr()
178 static int hdmi_set_pll_pwr(struct hdmi_ip_data *ip_data, enum hdmi_pll_pwr val) in hdmi_set_pll_pwr() argument
181 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, val, 3, 2); in hdmi_set_pll_pwr()
184 if (hdmi_wait_for_bit_change(hdmi_wp_base(ip_data), HDMI_WP_PWR_CTRL, in hdmi_set_pll_pwr()
193 static int hdmi_pll_reset(struct hdmi_ip_data *ip_data) in hdmi_pll_reset() argument
196 REG_FLD_MOD(hdmi_pll_base(ip_data), PLLCTRL_PLL_CONTROL, 0x0, 3, 3); in hdmi_pll_reset()
199 if (hdmi_wait_for_bit_change(hdmi_pll_base(ip_data), in hdmi_pll_reset()
208 int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_pll_enable() argument
212 r = hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_ALLOFF); in ti_hdmi_4xxx_pll_enable()
216 r = hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_BOTHON_ALLCLKS); in ti_hdmi_4xxx_pll_enable()
220 r = hdmi_pll_reset(ip_data); in ti_hdmi_4xxx_pll_enable()
224 r = hdmi_pll_init(ip_data); in ti_hdmi_4xxx_pll_enable()
231 void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_pll_disable() argument
233 hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_ALLOFF); in ti_hdmi_4xxx_pll_disable()
236 static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) in hdmi_check_hpd_state() argument
241 mutex_lock(&ip_data->lock); in hdmi_check_hpd_state()
243 hpd = gpio_get_value(ip_data->hpd_gpio); in hdmi_check_hpd_state()
246 r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_TXON); in hdmi_check_hpd_state()
248 r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON); in hdmi_check_hpd_state()
257 mutex_unlock(&ip_data->lock); in hdmi_check_hpd_state()
263 struct hdmi_ip_data *ip_data = data; in hpd_irq_handler() local
265 hdmi_check_hpd_state(ip_data); in hpd_irq_handler()
270 int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_phy_enable() argument
273 void __iomem *phy_base = hdmi_phy_base(ip_data); in ti_hdmi_4xxx_phy_enable()
275 r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON); in ti_hdmi_4xxx_phy_enable()
300 r = request_threaded_irq(gpio_to_irq(ip_data->hpd_gpio), in ti_hdmi_4xxx_phy_enable()
303 IRQF_ONESHOT, "hpd", ip_data); in ti_hdmi_4xxx_phy_enable()
306 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); in ti_hdmi_4xxx_phy_enable()
310 r = hdmi_check_hpd_state(ip_data); in ti_hdmi_4xxx_phy_enable()
312 free_irq(gpio_to_irq(ip_data->hpd_gpio), ip_data); in ti_hdmi_4xxx_phy_enable()
313 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); in ti_hdmi_4xxx_phy_enable()
320 void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_phy_disable() argument
322 free_irq(gpio_to_irq(ip_data->hpd_gpio), ip_data); in ti_hdmi_4xxx_phy_disable()
324 hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_OFF); in ti_hdmi_4xxx_phy_disable()
327 static int hdmi_core_ddc_init(struct hdmi_ip_data *ip_data) in hdmi_core_ddc_init() argument
329 void __iomem *base = hdmi_core_sys_base(ip_data); in hdmi_core_ddc_init()
369 static int hdmi_core_ddc_edid(struct hdmi_ip_data *ip_data, in hdmi_core_ddc_edid() argument
372 void __iomem *base = hdmi_core_sys_base(ip_data); in hdmi_core_ddc_edid()
451 int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, in ti_hdmi_4xxx_read_edid() argument
459 r = hdmi_core_ddc_init(ip_data); in ti_hdmi_4xxx_read_edid()
463 r = hdmi_core_ddc_edid(ip_data, edid, 0); in ti_hdmi_4xxx_read_edid()
470 r = hdmi_core_ddc_edid(ip_data, edid + 0x80, 1); in ti_hdmi_4xxx_read_edid()
479 bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_detect() argument
481 return gpio_get_value(ip_data->hpd_gpio); in ti_hdmi_4xxx_detect()
528 static void hdmi_core_powerdown_disable(struct hdmi_ip_data *ip_data) in hdmi_core_powerdown_disable() argument
531 REG_FLD_MOD(hdmi_core_sys_base(ip_data), HDMI_CORE_CTRL1, 0x0, 0, 0); in hdmi_core_powerdown_disable()
534 static void hdmi_core_swreset_release(struct hdmi_ip_data *ip_data) in hdmi_core_swreset_release() argument
537 REG_FLD_MOD(hdmi_core_sys_base(ip_data), HDMI_CORE_SYS_SRST, 0x0, 0, 0); in hdmi_core_swreset_release()
540 static void hdmi_core_swreset_assert(struct hdmi_ip_data *ip_data) in hdmi_core_swreset_assert() argument
543 REG_FLD_MOD(hdmi_core_sys_base(ip_data), HDMI_CORE_SYS_SRST, 0x1, 0, 0); in hdmi_core_swreset_assert()
547 static void hdmi_core_video_config(struct hdmi_ip_data *ip_data, in hdmi_core_video_config() argument
551 void __iomem *core_sys_base = hdmi_core_sys_base(ip_data); in hdmi_core_video_config()
578 r = hdmi_read_reg(hdmi_av_base(ip_data), HDMI_CORE_AV_HDMI_CTRL); in hdmi_core_video_config()
582 hdmi_write_reg(hdmi_av_base(ip_data), HDMI_CORE_AV_HDMI_CTRL, r); in hdmi_core_video_config()
589 static void hdmi_core_aux_infoframe_avi_config(struct hdmi_ip_data *ip_data) in hdmi_core_aux_infoframe_avi_config() argument
593 void __iomem *av_base = hdmi_av_base(ip_data); in hdmi_core_aux_infoframe_avi_config()
594 struct hdmi_core_infoframe_avi info_avi = ip_data->avi_cfg; in hdmi_core_aux_infoframe_avi_config()
665 static void hdmi_core_av_packet_config(struct hdmi_ip_data *ip_data, in hdmi_core_av_packet_config() argument
669 hdmi_write_reg(hdmi_av_base(ip_data), HDMI_CORE_AV_PB_CTRL1, in hdmi_core_av_packet_config()
676 hdmi_write_reg(hdmi_av_base(ip_data), HDMI_CORE_AV_PB_CTRL2, in hdmi_core_av_packet_config()
701 int ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_wp_video_start() argument
703 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, true, 31, 31); in ti_hdmi_4xxx_wp_video_start()
707 void ti_hdmi_4xxx_wp_video_stop(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_wp_video_stop() argument
709 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, false, 31, 31); in ti_hdmi_4xxx_wp_video_stop()
728 static void hdmi_wp_video_config_format(struct hdmi_ip_data *ip_data, in hdmi_wp_video_config_format() argument
733 REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, in hdmi_wp_video_config_format()
738 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_SIZE, l); in hdmi_wp_video_config_format()
741 static void hdmi_wp_video_config_interface(struct hdmi_ip_data *ip_data) in hdmi_wp_video_config_interface() argument
747 vsync_pol = ip_data->cfg.timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH; in hdmi_wp_video_config_interface()
748 hsync_pol = ip_data->cfg.timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH; in hdmi_wp_video_config_interface()
750 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG); in hdmi_wp_video_config_interface()
753 r = FLD_MOD(r, ip_data->cfg.timings.interlace, 3, 3); in hdmi_wp_video_config_interface()
755 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, r); in hdmi_wp_video_config_interface()
758 static void hdmi_wp_video_config_timing(struct hdmi_ip_data *ip_data, in hdmi_wp_video_config_timing() argument
769 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_TIMING_H, timing_h); in hdmi_wp_video_config_timing()
774 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_TIMING_V, timing_v); in hdmi_wp_video_config_timing()
777 void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_basic_configure() argument
783 struct hdmi_core_infoframe_avi avi_cfg = ip_data->avi_cfg; in ti_hdmi_4xxx_basic_configure()
786 struct hdmi_config *cfg = &ip_data->cfg; in ti_hdmi_4xxx_basic_configure()
796 hdmi_wp_video_config_timing(ip_data, &video_timing); in ti_hdmi_4xxx_basic_configure()
801 hdmi_wp_video_config_format(ip_data, &video_format); in ti_hdmi_4xxx_basic_configure()
803 hdmi_wp_video_config_interface(ip_data); in ti_hdmi_4xxx_basic_configure()
809 hdmi_core_swreset_assert(ip_data); in ti_hdmi_4xxx_basic_configure()
812 hdmi_core_powerdown_disable(ip_data); in ti_hdmi_4xxx_basic_configure()
817 hdmi_core_video_config(ip_data, &v_core_cfg); in ti_hdmi_4xxx_basic_configure()
820 hdmi_core_swreset_release(ip_data); in ti_hdmi_4xxx_basic_configure()
845 hdmi_core_aux_infoframe_avi_config(ip_data); in ti_hdmi_4xxx_basic_configure()
853 hdmi_core_av_packet_config(ip_data, repeat_cfg); in ti_hdmi_4xxx_basic_configure()
856 void ti_hdmi_4xxx_wp_dump(struct hdmi_ip_data *ip_data, struct seq_file *s) in ti_hdmi_4xxx_wp_dump() argument
859 hdmi_read_reg(hdmi_wp_base(ip_data), r)) in ti_hdmi_4xxx_wp_dump()
878 void ti_hdmi_4xxx_pll_dump(struct hdmi_ip_data *ip_data, struct seq_file *s) in ti_hdmi_4xxx_pll_dump() argument
881 hdmi_read_reg(hdmi_pll_base(ip_data), r)) in ti_hdmi_4xxx_pll_dump()
892 void ti_hdmi_4xxx_core_dump(struct hdmi_ip_data *ip_data, struct seq_file *s) in ti_hdmi_4xxx_core_dump() argument
898 hdmi_read_reg(hdmi_core_sys_base(ip_data), r)) in ti_hdmi_4xxx_core_dump()
900 hdmi_read_reg(hdmi_av_base(ip_data), r)) in ti_hdmi_4xxx_core_dump()
903 hdmi_read_reg(hdmi_av_base(ip_data), CORE_REG(i, r))) in ti_hdmi_4xxx_core_dump()
1015 void ti_hdmi_4xxx_phy_dump(struct hdmi_ip_data *ip_data, struct seq_file *s) in ti_hdmi_4xxx_phy_dump() argument
1018 hdmi_read_reg(hdmi_phy_base(ip_data), r)) in ti_hdmi_4xxx_phy_dump()
1027 static void ti_hdmi_4xxx_wp_audio_config_format(struct hdmi_ip_data *ip_data, in ti_hdmi_4xxx_wp_audio_config_format() argument
1034 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG); in ti_hdmi_4xxx_wp_audio_config_format()
1043 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG, r); in ti_hdmi_4xxx_wp_audio_config_format()
1046 static void ti_hdmi_4xxx_wp_audio_config_dma(struct hdmi_ip_data *ip_data, in ti_hdmi_4xxx_wp_audio_config_dma() argument
1053 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG2); in ti_hdmi_4xxx_wp_audio_config_dma()
1056 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CFG2, r); in ti_hdmi_4xxx_wp_audio_config_dma()
1058 r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CTRL); in ti_hdmi_4xxx_wp_audio_config_dma()
1061 hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_AUDIO_CTRL, r); in ti_hdmi_4xxx_wp_audio_config_dma()
1064 static void ti_hdmi_4xxx_core_audio_config(struct hdmi_ip_data *ip_data, in ti_hdmi_4xxx_core_audio_config() argument
1068 void __iomem *av_base = hdmi_av_base(ip_data); in ti_hdmi_4xxx_core_audio_config()
1163 static void ti_hdmi_4xxx_core_audio_infoframe_cfg(struct hdmi_ip_data *ip_data, in ti_hdmi_4xxx_core_audio_infoframe_cfg() argument
1167 void __iomem *av_base = hdmi_av_base(ip_data); in ti_hdmi_4xxx_core_audio_infoframe_cfg()
1213 int ti_hdmi_4xxx_audio_config(struct hdmi_ip_data *ip_data, in ti_hdmi_4xxx_audio_config() argument
1223 if (!audio || !audio->iec || !audio->cea || !ip_data) in ti_hdmi_4xxx_audio_config()
1380 ti_hdmi_4xxx_wp_audio_config_dma(ip_data, &audio_dma); in ti_hdmi_4xxx_audio_config()
1381 ti_hdmi_4xxx_wp_audio_config_format(ip_data, &audio_format); in ti_hdmi_4xxx_audio_config()
1384 ti_hdmi_4xxx_core_audio_config(ip_data, &core); in ti_hdmi_4xxx_audio_config()
1387 ti_hdmi_4xxx_core_audio_infoframe_cfg(ip_data, audio->cea); in ti_hdmi_4xxx_audio_config()
1392 int ti_hdmi_4xxx_wp_audio_enable(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_wp_audio_enable() argument
1394 REG_FLD_MOD(hdmi_wp_base(ip_data), in ti_hdmi_4xxx_wp_audio_enable()
1399 void ti_hdmi_4xxx_wp_audio_disable(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_wp_audio_disable() argument
1401 REG_FLD_MOD(hdmi_wp_base(ip_data), in ti_hdmi_4xxx_wp_audio_disable()
1405 int ti_hdmi_4xxx_audio_start(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_audio_start() argument
1407 REG_FLD_MOD(hdmi_av_base(ip_data), in ti_hdmi_4xxx_audio_start()
1409 REG_FLD_MOD(hdmi_wp_base(ip_data), in ti_hdmi_4xxx_audio_start()
1414 void ti_hdmi_4xxx_audio_stop(struct hdmi_ip_data *ip_data) in ti_hdmi_4xxx_audio_stop() argument
1416 REG_FLD_MOD(hdmi_av_base(ip_data), in ti_hdmi_4xxx_audio_stop()
1418 REG_FLD_MOD(hdmi_wp_base(ip_data), in ti_hdmi_4xxx_audio_stop()