Lines Matching +full:prop +full:-
1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2 // Copyright(c) 2015-17 Intel Corporation.
27 * sdw_master_read_prop() - Read Master properties
32 struct sdw_master_prop *prop = &bus->prop; in sdw_master_read_prop() local
37 device_property_read_u32(bus->dev, in sdw_master_read_prop()
38 "mipi-sdw-sw-interface-revision", in sdw_master_read_prop()
39 &prop->revision); in sdw_master_read_prop()
43 "mipi-sdw-link-%d-subproperties", bus->link_id); in sdw_master_read_prop()
45 link = device_get_named_child_node(bus->dev, name); in sdw_master_read_prop()
47 dev_err(bus->dev, "Master node %s not found\n", name); in sdw_master_read_prop()
48 return -EIO; in sdw_master_read_prop()
52 "mipi-sdw-clock-stop-mode0-supported")) in sdw_master_read_prop()
53 prop->clk_stop_modes |= BIT(SDW_CLK_STOP_MODE0); in sdw_master_read_prop()
56 "mipi-sdw-clock-stop-mode1-supported")) in sdw_master_read_prop()
57 prop->clk_stop_modes |= BIT(SDW_CLK_STOP_MODE1); in sdw_master_read_prop()
60 "mipi-sdw-max-clock-frequency", in sdw_master_read_prop()
61 &prop->max_clk_freq); in sdw_master_read_prop()
63 nval = fwnode_property_count_u32(link, "mipi-sdw-clock-frequencies-supported"); in sdw_master_read_prop()
65 prop->num_clk_freq = nval; in sdw_master_read_prop()
66 prop->clk_freq = devm_kcalloc(bus->dev, prop->num_clk_freq, in sdw_master_read_prop()
67 sizeof(*prop->clk_freq), in sdw_master_read_prop()
69 if (!prop->clk_freq) { in sdw_master_read_prop()
71 return -ENOMEM; in sdw_master_read_prop()
75 "mipi-sdw-clock-frequencies-supported", in sdw_master_read_prop()
76 prop->clk_freq, prop->num_clk_freq); in sdw_master_read_prop()
83 if (!prop->max_clk_freq && prop->clk_freq) { in sdw_master_read_prop()
84 prop->max_clk_freq = prop->clk_freq[0]; in sdw_master_read_prop()
85 for (i = 1; i < prop->num_clk_freq; i++) { in sdw_master_read_prop()
86 if (prop->clk_freq[i] > prop->max_clk_freq) in sdw_master_read_prop()
87 prop->max_clk_freq = prop->clk_freq[i]; in sdw_master_read_prop()
91 nval = fwnode_property_count_u32(link, "mipi-sdw-supported-clock-gears"); in sdw_master_read_prop()
93 prop->num_clk_gears = nval; in sdw_master_read_prop()
94 prop->clk_gears = devm_kcalloc(bus->dev, prop->num_clk_gears, in sdw_master_read_prop()
95 sizeof(*prop->clk_gears), in sdw_master_read_prop()
97 if (!prop->clk_gears) { in sdw_master_read_prop()
99 return -ENOMEM; in sdw_master_read_prop()
103 "mipi-sdw-supported-clock-gears", in sdw_master_read_prop()
104 prop->clk_gears, in sdw_master_read_prop()
105 prop->num_clk_gears); in sdw_master_read_prop()
108 fwnode_property_read_u32(link, "mipi-sdw-default-frame-rate", in sdw_master_read_prop()
109 &prop->default_frame_rate); in sdw_master_read_prop()
111 fwnode_property_read_u32(link, "mipi-sdw-default-frame-row-size", in sdw_master_read_prop()
112 &prop->default_row); in sdw_master_read_prop()
114 fwnode_property_read_u32(link, "mipi-sdw-default-frame-col-size", in sdw_master_read_prop()
115 &prop->default_col); in sdw_master_read_prop()
117 prop->dynamic_frame = fwnode_property_read_bool(link, in sdw_master_read_prop()
118 "mipi-sdw-dynamic-frame-shape"); in sdw_master_read_prop()
120 fwnode_property_read_u32(link, "mipi-sdw-command-error-threshold", in sdw_master_read_prop()
121 &prop->err_threshold); in sdw_master_read_prop()
135 fwnode_property_read_u32(port, "mipi-sdw-port-max-wordlength", in sdw_slave_read_dp0()
136 &dp0->max_word); in sdw_slave_read_dp0()
138 fwnode_property_read_u32(port, "mipi-sdw-port-min-wordlength", in sdw_slave_read_dp0()
139 &dp0->min_word); in sdw_slave_read_dp0()
141 nval = fwnode_property_count_u32(port, "mipi-sdw-port-wordlength-configs"); in sdw_slave_read_dp0()
144 dp0->num_words = nval; in sdw_slave_read_dp0()
145 dp0->words = devm_kcalloc(&slave->dev, in sdw_slave_read_dp0()
146 dp0->num_words, sizeof(*dp0->words), in sdw_slave_read_dp0()
148 if (!dp0->words) in sdw_slave_read_dp0()
149 return -ENOMEM; in sdw_slave_read_dp0()
152 "mipi-sdw-port-wordlength-configs", in sdw_slave_read_dp0()
153 dp0->words, dp0->num_words); in sdw_slave_read_dp0()
156 dp0->BRA_flow_controlled = fwnode_property_read_bool(port, in sdw_slave_read_dp0()
157 "mipi-sdw-bra-flow-controlled"); in sdw_slave_read_dp0()
159 dp0->simple_ch_prep_sm = fwnode_property_read_bool(port, in sdw_slave_read_dp0()
160 "mipi-sdw-simplified-channel-prepare-sm"); in sdw_slave_read_dp0()
162 dp0->imp_def_interrupts = fwnode_property_read_bool(port, in sdw_slave_read_dp0()
163 "mipi-sdw-imp-def-dp0-interrupts-supported"); in sdw_slave_read_dp0()
184 "mipi-sdw-dp-%d-%s-subproperties", bit, type); in sdw_slave_read_dpn()
188 node = device_get_named_child_node(&slave->dev, name); in sdw_slave_read_dpn()
190 dev_err(&slave->dev, "%s dpN not found\n", name); in sdw_slave_read_dpn()
191 return -EIO; in sdw_slave_read_dpn()
194 fwnode_property_read_u32(node, "mipi-sdw-port-max-wordlength", in sdw_slave_read_dpn()
196 fwnode_property_read_u32(node, "mipi-sdw-port-min-wordlength", in sdw_slave_read_dpn()
199 nval = fwnode_property_count_u32(node, "mipi-sdw-port-wordlength-configs"); in sdw_slave_read_dpn()
202 dpn[i].words = devm_kcalloc(&slave->dev, in sdw_slave_read_dpn()
208 return -ENOMEM; in sdw_slave_read_dpn()
212 "mipi-sdw-port-wordlength-configs", in sdw_slave_read_dpn()
216 fwnode_property_read_u32(node, "mipi-sdw-data-port-type", in sdw_slave_read_dpn()
220 "mipi-sdw-max-grouping-supported", in sdw_slave_read_dpn()
224 "mipi-sdw-simplified-channelprepare-sm"); in sdw_slave_read_dpn()
227 "mipi-sdw-port-channelprepare-timeout", in sdw_slave_read_dpn()
231 "mipi-sdw-imp-def-dpn-interrupts-supported", in sdw_slave_read_dpn()
234 fwnode_property_read_u32(node, "mipi-sdw-min-channel-number", in sdw_slave_read_dpn()
237 fwnode_property_read_u32(node, "mipi-sdw-max-channel-number", in sdw_slave_read_dpn()
240 nval = fwnode_property_count_u32(node, "mipi-sdw-channel-number-list"); in sdw_slave_read_dpn()
243 dpn[i].channels = devm_kcalloc(&slave->dev, in sdw_slave_read_dpn()
249 return -ENOMEM; in sdw_slave_read_dpn()
253 "mipi-sdw-channel-number-list", in sdw_slave_read_dpn()
257 nval = fwnode_property_count_u32(node, "mipi-sdw-channel-combination-list"); in sdw_slave_read_dpn()
260 dpn[i].ch_combinations = devm_kcalloc(&slave->dev, in sdw_slave_read_dpn()
266 return -ENOMEM; in sdw_slave_read_dpn()
270 "mipi-sdw-channel-combination-list", in sdw_slave_read_dpn()
276 "mipi-sdw-modes-supported", &dpn[i].modes); in sdw_slave_read_dpn()
278 fwnode_property_read_u32(node, "mipi-sdw-max-async-buffer", in sdw_slave_read_dpn()
282 "mipi-sdw-block-packing-mode"); in sdw_slave_read_dpn()
284 fwnode_property_read_u32(node, "mipi-sdw-port-encoding-type", in sdw_slave_read_dpn()
298 * sdw_slave_read_prop() - Read Slave properties
303 struct sdw_slave_prop *prop = &slave->prop; in sdw_slave_read_prop() local
304 struct device *dev = &slave->dev; in sdw_slave_read_prop()
308 device_property_read_u32(dev, "mipi-sdw-sw-interface-revision", in sdw_slave_read_prop()
309 &prop->mipi_revision); in sdw_slave_read_prop()
311 prop->wake_capable = device_property_read_bool(dev, in sdw_slave_read_prop()
312 "mipi-sdw-wake-up-unavailable"); in sdw_slave_read_prop()
313 prop->wake_capable = !prop->wake_capable; in sdw_slave_read_prop()
315 prop->test_mode_capable = device_property_read_bool(dev, in sdw_slave_read_prop()
316 "mipi-sdw-test-mode-supported"); in sdw_slave_read_prop()
318 prop->clk_stop_mode1 = false; in sdw_slave_read_prop()
320 "mipi-sdw-clock-stop-mode1-supported")) in sdw_slave_read_prop()
321 prop->clk_stop_mode1 = true; in sdw_slave_read_prop()
323 prop->simple_clk_stop_capable = device_property_read_bool(dev, in sdw_slave_read_prop()
324 "mipi-sdw-simplified-clockstopprepare-sm-supported"); in sdw_slave_read_prop()
326 device_property_read_u32(dev, "mipi-sdw-clockstopprepare-timeout", in sdw_slave_read_prop()
327 &prop->clk_stop_timeout); in sdw_slave_read_prop()
329 device_property_read_u32(dev, "mipi-sdw-slave-channelprepare-timeout", in sdw_slave_read_prop()
330 &prop->ch_prep_timeout); in sdw_slave_read_prop()
333 "mipi-sdw-clockstopprepare-hard-reset-behavior", in sdw_slave_read_prop()
334 &prop->reset_behave); in sdw_slave_read_prop()
336 prop->high_PHY_capable = device_property_read_bool(dev, in sdw_slave_read_prop()
337 "mipi-sdw-highPHY-capable"); in sdw_slave_read_prop()
339 prop->paging_support = device_property_read_bool(dev, in sdw_slave_read_prop()
340 "mipi-sdw-paging-support"); in sdw_slave_read_prop()
342 prop->bank_delay_support = device_property_read_bool(dev, in sdw_slave_read_prop()
343 "mipi-sdw-bank-delay-support"); in sdw_slave_read_prop()
346 "mipi-sdw-port15-read-behavior", &prop->p15_behave); in sdw_slave_read_prop()
348 device_property_read_u32(dev, "mipi-sdw-master-count", in sdw_slave_read_prop()
349 &prop->master_count); in sdw_slave_read_prop()
351 device_property_read_u32(dev, "mipi-sdw-source-port-list", in sdw_slave_read_prop()
352 &prop->source_ports); in sdw_slave_read_prop()
354 device_property_read_u32(dev, "mipi-sdw-sink-port-list", in sdw_slave_read_prop()
355 &prop->sink_ports); in sdw_slave_read_prop()
358 port = device_get_named_child_node(dev, "mipi-sdw-dp-0-subproperties"); in sdw_slave_read_prop()
362 prop->dp0_prop = devm_kzalloc(&slave->dev, in sdw_slave_read_prop()
363 sizeof(*prop->dp0_prop), in sdw_slave_read_prop()
365 if (!prop->dp0_prop) { in sdw_slave_read_prop()
367 return -ENOMEM; in sdw_slave_read_prop()
370 sdw_slave_read_dp0(slave, port, prop->dp0_prop); in sdw_slave_read_prop()
381 nval = hweight32(prop->source_ports); in sdw_slave_read_prop()
382 prop->src_dpn_prop = devm_kcalloc(&slave->dev, nval, in sdw_slave_read_prop()
383 sizeof(*prop->src_dpn_prop), in sdw_slave_read_prop()
385 if (!prop->src_dpn_prop) in sdw_slave_read_prop()
386 return -ENOMEM; in sdw_slave_read_prop()
389 sdw_slave_read_dpn(slave, prop->src_dpn_prop, nval, in sdw_slave_read_prop()
390 prop->source_ports, "source"); in sdw_slave_read_prop()
392 nval = hweight32(prop->sink_ports); in sdw_slave_read_prop()
393 prop->sink_dpn_prop = devm_kcalloc(&slave->dev, nval, in sdw_slave_read_prop()
394 sizeof(*prop->sink_dpn_prop), in sdw_slave_read_prop()
396 if (!prop->sink_dpn_prop) in sdw_slave_read_prop()
397 return -ENOMEM; in sdw_slave_read_prop()
400 sdw_slave_read_dpn(slave, prop->sink_dpn_prop, nval, in sdw_slave_read_prop()
401 prop->sink_ports, "sink"); in sdw_slave_read_prop()