Lines Matching +full:single +full:- +full:link
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
39 struct platform_device *pdev = parser->pdev; in dp_parser_ctrl_res()
40 struct dp_io *io = &parser->io; in dp_parser_ctrl_res()
41 struct dss_io_data *dss = &io->dp_controller; in dp_parser_ctrl_res()
43 dss->ahb.base = dp_ioremap(pdev, 0, &dss->ahb.len); in dp_parser_ctrl_res()
44 if (IS_ERR(dss->ahb.base)) in dp_parser_ctrl_res()
45 return PTR_ERR(dss->ahb.base); in dp_parser_ctrl_res()
47 dss->aux.base = dp_ioremap(pdev, 1, &dss->aux.len); in dp_parser_ctrl_res()
48 if (IS_ERR(dss->aux.base)) { in dp_parser_ctrl_res()
50 * The initial binding had a single reg, but in order to in dp_parser_ctrl_res()
51 * support variation in the sub-region sizes this was split. in dp_parser_ctrl_res()
52 * dp_ioremap() will fail with -EINVAL here if only a single in dp_parser_ctrl_res()
53 * reg is specified, so fill in the sub-region offsets and in dp_parser_ctrl_res()
54 * lengths based on this single region. in dp_parser_ctrl_res()
56 if (PTR_ERR(dss->aux.base) == -EINVAL) { in dp_parser_ctrl_res()
57 if (dss->ahb.len < DP_DEFAULT_P0_OFFSET + DP_DEFAULT_P0_SIZE) { in dp_parser_ctrl_res()
59 return -EINVAL; in dp_parser_ctrl_res()
62 dss->ahb.len = DP_DEFAULT_AHB_SIZE; in dp_parser_ctrl_res()
63 dss->aux.base = dss->ahb.base + DP_DEFAULT_AUX_OFFSET; in dp_parser_ctrl_res()
64 dss->aux.len = DP_DEFAULT_AUX_SIZE; in dp_parser_ctrl_res()
65 dss->link.base = dss->ahb.base + DP_DEFAULT_LINK_OFFSET; in dp_parser_ctrl_res()
66 dss->link.len = DP_DEFAULT_LINK_SIZE; in dp_parser_ctrl_res()
67 dss->p0.base = dss->ahb.base + DP_DEFAULT_P0_OFFSET; in dp_parser_ctrl_res()
68 dss->p0.len = DP_DEFAULT_P0_SIZE; in dp_parser_ctrl_res()
70 DRM_ERROR("unable to remap aux region: %pe\n", dss->aux.base); in dp_parser_ctrl_res()
71 return PTR_ERR(dss->aux.base); in dp_parser_ctrl_res()
74 dss->link.base = dp_ioremap(pdev, 2, &dss->link.len); in dp_parser_ctrl_res()
75 if (IS_ERR(dss->link.base)) { in dp_parser_ctrl_res()
76 DRM_ERROR("unable to remap link region: %pe\n", dss->link.base); in dp_parser_ctrl_res()
77 return PTR_ERR(dss->link.base); in dp_parser_ctrl_res()
80 dss->p0.base = dp_ioremap(pdev, 3, &dss->p0.len); in dp_parser_ctrl_res()
81 if (IS_ERR(dss->p0.base)) { in dp_parser_ctrl_res()
82 DRM_ERROR("unable to remap p0 region: %pe\n", dss->p0.base); in dp_parser_ctrl_res()
83 return PTR_ERR(dss->p0.base); in dp_parser_ctrl_res()
87 io->phy = devm_phy_get(&pdev->dev, "dp"); in dp_parser_ctrl_res()
88 if (IS_ERR(io->phy)) in dp_parser_ctrl_res()
89 return PTR_ERR(io->phy); in dp_parser_ctrl_res()
96 struct device_node *of_node = parser->pdev->dev.of_node; in dp_parser_misc()
101 DRM_WARN("Invalid property \"data-lanes\", default max DP lanes = %d\n", in dp_parser_misc()
106 parser->max_dp_lanes = len; in dp_parser_misc()
121 struct device *dev = &parser->pdev->dev; in dp_parser_init_clk_data()
122 struct dss_module_power *core_power = &parser->mp[DP_CORE_PM]; in dp_parser_init_clk_data()
123 struct dss_module_power *ctrl_power = &parser->mp[DP_CTRL_PM]; in dp_parser_init_clk_data()
124 struct dss_module_power *stream_power = &parser->mp[DP_STREAM_PM]; in dp_parser_init_clk_data()
126 num_clk = of_property_count_strings(dev->of_node, "clock-names"); in dp_parser_init_clk_data()
129 return -EINVAL; in dp_parser_init_clk_data()
133 rc = of_property_read_string_index(dev->of_node, in dp_parser_init_clk_data()
134 "clock-names", i, &clk_name); in dp_parser_init_clk_data()
151 return -EINVAL; in dp_parser_init_clk_data()
154 core_power->num_clk = core_clk_count; in dp_parser_init_clk_data()
155 core_power->clocks = devm_kcalloc(dev, in dp_parser_init_clk_data()
156 core_power->num_clk, sizeof(struct clk_bulk_data), in dp_parser_init_clk_data()
158 if (!core_power->clocks) in dp_parser_init_clk_data()
159 return -ENOMEM; in dp_parser_init_clk_data()
164 return -EINVAL; in dp_parser_init_clk_data()
167 ctrl_power->num_clk = ctrl_clk_count; in dp_parser_init_clk_data()
168 ctrl_power->clocks = devm_kcalloc(dev, in dp_parser_init_clk_data()
169 ctrl_power->num_clk, sizeof(struct clk_bulk_data), in dp_parser_init_clk_data()
171 if (!ctrl_power->clocks) { in dp_parser_init_clk_data()
172 ctrl_power->num_clk = 0; in dp_parser_init_clk_data()
173 return -ENOMEM; in dp_parser_init_clk_data()
179 return -EINVAL; in dp_parser_init_clk_data()
182 stream_power->num_clk = stream_clk_count; in dp_parser_init_clk_data()
183 stream_power->clocks = devm_kcalloc(dev, in dp_parser_init_clk_data()
184 stream_power->num_clk, sizeof(struct clk_bulk_data), in dp_parser_init_clk_data()
186 if (!stream_power->clocks) { in dp_parser_init_clk_data()
187 stream_power->num_clk = 0; in dp_parser_init_clk_data()
188 return -ENOMEM; in dp_parser_init_clk_data()
201 struct device *dev = &parser->pdev->dev; in dp_parser_clock()
202 struct dss_module_power *core_power = &parser->mp[DP_CORE_PM]; in dp_parser_clock()
203 struct dss_module_power *ctrl_power = &parser->mp[DP_CTRL_PM]; in dp_parser_clock()
204 struct dss_module_power *stream_power = &parser->mp[DP_STREAM_PM]; in dp_parser_clock()
209 return -EINVAL; in dp_parser_clock()
212 core_clk_count = core_power->num_clk; in dp_parser_clock()
213 ctrl_clk_count = ctrl_power->num_clk; in dp_parser_clock()
214 stream_clk_count = stream_power->num_clk; in dp_parser_clock()
219 rc = of_property_read_string_index(dev->of_node, "clock-names", in dp_parser_clock()
222 DRM_ERROR("error reading clock-names %d\n", rc); in dp_parser_clock()
227 core_power->clocks[core_clk_index].id = devm_kstrdup(dev, clk_name, GFP_KERNEL); in dp_parser_clock()
231 stream_power->clocks[stream_clk_index].id = devm_kstrdup(dev, clk_name, GFP_KERNEL); in dp_parser_clock()
235 ctrl_power->clocks[ctrl_clk_index].id = devm_kstrdup(dev, clk_name, GFP_KERNEL); in dp_parser_clock()
245 struct platform_device *pdev = parser->pdev; in devm_dp_parser_find_next_bridge()
248 bridge = devm_drm_of_get_bridge(dev, pdev->dev.of_node, 1, 0); in devm_dp_parser_find_next_bridge()
252 parser->next_bridge = bridge; in devm_dp_parser_find_next_bridge()
263 return -EINVAL; in dp_parser_parse()
285 parser = devm_kzalloc(&pdev->dev, sizeof(*parser), GFP_KERNEL); in dp_parser_get()
287 return ERR_PTR(-ENOMEM); in dp_parser_get()
289 parser->parse = dp_parser_parse; in dp_parser_get()
290 parser->pdev = pdev; in dp_parser_get()