Lines Matching full:ddc
65 struct sun4i_ddc *ddc = hw_to_ddc(hw); in sun4i_ddc_round_rate() local
67 return sun4i_ddc_calc_divider(rate, *prate, ddc->pre_div, in sun4i_ddc_round_rate()
68 ddc->m_offset, NULL, NULL); in sun4i_ddc_round_rate()
74 struct sun4i_ddc *ddc = hw_to_ddc(hw); in sun4i_ddc_recalc_rate() local
78 regmap_field_read(ddc->reg, ®); in sun4i_ddc_recalc_rate()
82 return (((parent_rate / ddc->pre_div) / 10) >> n) / in sun4i_ddc_recalc_rate()
83 (m + ddc->m_offset); in sun4i_ddc_recalc_rate()
89 struct sun4i_ddc *ddc = hw_to_ddc(hw); in sun4i_ddc_set_rate() local
92 sun4i_ddc_calc_divider(rate, parent_rate, ddc->pre_div, in sun4i_ddc_set_rate()
93 ddc->m_offset, &div_m, &div_n); in sun4i_ddc_set_rate()
95 regmap_field_write(ddc->reg, in sun4i_ddc_set_rate()
111 struct sun4i_ddc *ddc; in sun4i_ddc_create() local
118 ddc = devm_kzalloc(hdmi->dev, sizeof(*ddc), GFP_KERNEL); in sun4i_ddc_create()
119 if (!ddc) in sun4i_ddc_create()
122 ddc->reg = devm_regmap_field_alloc(hdmi->dev, hdmi->regmap, in sun4i_ddc_create()
124 if (IS_ERR(ddc->reg)) in sun4i_ddc_create()
125 return PTR_ERR(ddc->reg); in sun4i_ddc_create()
127 init.name = "hdmi-ddc"; in sun4i_ddc_create()
132 ddc->hdmi = hdmi; in sun4i_ddc_create()
133 ddc->hw.init = &init; in sun4i_ddc_create()
134 ddc->pre_div = hdmi->variant->ddc_clk_pre_divider; in sun4i_ddc_create()
135 ddc->m_offset = hdmi->variant->ddc_clk_m_offset; in sun4i_ddc_create()
137 hdmi->ddc_clk = devm_clk_register(hdmi->dev, &ddc->hw); in sun4i_ddc_create()