Lines Matching +full:imx6q +full:- +full:iomuxc +full:- +full:gpr
15 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
67 { .compatible = "fsl,imx1-weim", .data = &imx1_weim_devtype, },
69 { .compatible = "fsl,imx27-weim", .data = &imx27_weim_devtype, },
71 { .compatible = "fsl,imx50-weim", .data = &imx50_weim_devtype, },
72 { .compatible = "fsl,imx6q-weim", .data = &imx50_weim_devtype, },
74 { .compatible = "fsl,imx51-weim", .data = &imx51_weim_devtype, },
81 struct device_node *np = pdev->dev.of_node; in imx_weim_gpr_setup()
84 struct regmap *gpr; in imx_weim_gpr_setup() local
96 gpr = syscon_regmap_lookup_by_phandle(np, "fsl,weim-cs-gpr"); in imx_weim_gpr_setup()
97 if (IS_ERR(gpr)) { in imx_weim_gpr_setup()
98 dev_dbg(&pdev->dev, "failed to find weim-cs-gpr\n"); in imx_weim_gpr_setup()
118 regmap_update_bits(gpr, IOMUXC_GPR1, 0xfff, gprval); in imx_weim_gpr_setup()
124 dev_err(&pdev->dev, "Invalid 'ranges' configuration\n"); in imx_weim_gpr_setup()
125 return -EINVAL; in imx_weim_gpr_setup()
139 if (WARN_ON(devtype->cs_regs_count > MAX_CS_REGS_COUNT)) in weim_timing_setup()
140 return -EINVAL; in weim_timing_setup()
141 if (WARN_ON(devtype->cs_count > MAX_CS_COUNT)) in weim_timing_setup()
142 return -EINVAL; in weim_timing_setup()
144 ret = of_property_read_u32_array(np, "fsl,weim-cs-timing", in weim_timing_setup()
145 value, devtype->cs_regs_count); in weim_timing_setup()
157 return -EINVAL; in weim_timing_setup()
165 if (cs_idx >= devtype->cs_count) in weim_timing_setup()
166 return -EINVAL; in weim_timing_setup()
168 /* prevent re-configuring a CS that's already been configured */ in weim_timing_setup()
169 cst = &ts->cs[cs_idx]; in weim_timing_setup()
170 if (cst->is_applied && memcmp(value, cst->regs, in weim_timing_setup()
171 devtype->cs_regs_count * sizeof(u32))) { in weim_timing_setup()
172 dev_err(dev, "fsl,weim-cs-timing conflict on %pOF", np); in weim_timing_setup()
173 return -EINVAL; in weim_timing_setup()
177 for (i = 0; i < devtype->cs_regs_count; i++) in weim_timing_setup()
179 base + cs_idx * devtype->cs_stride + i * 4); in weim_timing_setup()
180 if (!cst->is_applied) { in weim_timing_setup()
181 cst->is_applied = true; in weim_timing_setup()
182 memcpy(cst->regs, value, in weim_timing_setup()
183 devtype->cs_regs_count * sizeof(u32)); in weim_timing_setup()
193 &pdev->dev); in weim_parse_dt()
194 const struct imx_weim_devtype *devtype = of_id->data; in weim_parse_dt()
206 if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) { in weim_parse_dt()
207 if (devtype->wcr_bcm) { in weim_parse_dt()
208 reg = readl(base + devtype->wcr_offset); in weim_parse_dt()
209 writel(reg | devtype->wcr_bcm, in weim_parse_dt()
210 base + devtype->wcr_offset); in weim_parse_dt()
212 dev_err(&pdev->dev, "burst clk mode not supported.\n"); in weim_parse_dt()
213 return -EINVAL; in weim_parse_dt()
217 for_each_available_child_of_node(pdev->dev.of_node, child) { in weim_parse_dt()
218 ret = weim_timing_setup(&pdev->dev, child, base, devtype, &ts); in weim_parse_dt()
220 dev_warn(&pdev->dev, "%pOF set timing failed.\n", in weim_parse_dt()
227 ret = of_platform_default_populate(pdev->dev.of_node, in weim_parse_dt()
228 NULL, &pdev->dev); in weim_parse_dt()
230 dev_err(&pdev->dev, "%pOF fail to create devices.\n", in weim_parse_dt()
231 pdev->dev.of_node); in weim_parse_dt()
244 base = devm_ioremap_resource(&pdev->dev, res); in weim_probe()
249 clk = devm_clk_get(&pdev->dev, NULL); in weim_probe()
262 dev_info(&pdev->dev, "Driver registered.\n"); in weim_probe()
269 .name = "imx-weim",