Skip to content

Commit e4fa3c7

Browse files
committed
Merge tag 'imx-drivers-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/drivers
i.MX drivers update for 6.4: - Use dev_err_probe() for imx-scu driver to silences EPROBE_DEFER messages. - Add LVDS LPI2C and PWM power domains for scu-pd driver. - A series from Jindong Yue to support module build of imx8m soc driver. - Update imx8m-blk-ctrl driver to scan child nodes for binding drivers. - Reorder structure members in imx8m-blk-ctrl driver by following clang-analyzer suggestion. - Update imx-weim bus driver to use helper function for "ranges" parsing. * tag 'imx-drivers-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: imx8m-blk-ctrl: reordering the fields soc: imx8m: Support building imx8m soc driver as module soc: imx8m: Add MODULE_LICENSE soc: imx: imx8m-blk-ctrl: Add MODULE_LICENSE soc: imx: imx8m-blk-ctrl: Use dev_pm_domain_attach_by_name soc: imx: imx8mp-blk-ctrl: Add MODULE_LICENSE soc: imx: imx8mp-blk-ctrl: Fix typo of imx8m_blk_ctrl_of_match soc: imx: imx8mp-blk-ctrl: Use dev_pm_domain_attach_by_name soc: imx: imx8m-blk-ctrl: Scan subnodes and bind drivers to them firmware: imx: scu-pd: add missed lvds lpi2c and pwm power domains bus: imx-weim: Remove open coded "ranges" parsing firmware: imx: scu: use dev_err_probe Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 3d3b32a + 816aec0 commit e4fa3c7

File tree

7 files changed

+29
-18
lines changed

7 files changed

+29
-18
lines changed

drivers/bus/imx-weim.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/module.h>
1111
#include <linux/clk.h>
1212
#include <linux/io.h>
13+
#include <linux/of_address.h>
1314
#include <linux/of_device.h>
1415
#include <linux/mfd/syscon.h>
1516
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
@@ -86,8 +87,8 @@ MODULE_DEVICE_TABLE(of, weim_id_table);
8687
static int imx_weim_gpr_setup(struct platform_device *pdev)
8788
{
8889
struct device_node *np = pdev->dev.of_node;
89-
struct property *prop;
90-
const __be32 *p;
90+
struct of_range_parser parser;
91+
struct of_range range;
9192
struct regmap *gpr;
9293
u32 gprvals[4] = {
9394
05, /* CS0(128M) CS1(0M) CS2(0M) CS3(0M) */
@@ -106,13 +107,13 @@ static int imx_weim_gpr_setup(struct platform_device *pdev)
106107
return 0;
107108
}
108109

109-
of_property_for_each_u32(np, "ranges", prop, p, val) {
110-
if (i % 4 == 0) {
111-
cs = val;
112-
} else if (i % 4 == 3 && val) {
113-
val = (val / SZ_32M) | 1;
114-
gprval |= val << cs * 3;
115-
}
110+
if (of_range_parser_init(&parser, np))
111+
goto err;
112+
113+
for_each_of_range(&parser, &range) {
114+
cs = range.bus_addr >> 32;
115+
val = (range.size / SZ_32M) | 1;
116+
gprval |= val << cs * 3;
116117
i++;
117118
}
118119

drivers/firmware/imx/imx-scu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,8 @@ static int imx_scu_probe(struct platform_device *pdev)
310310
sc_chan->ch = mbox_request_channel_byname(cl, chan_name);
311311
if (IS_ERR(sc_chan->ch)) {
312312
ret = PTR_ERR(sc_chan->ch);
313-
if (ret != -EPROBE_DEFER)
314-
dev_err(dev, "Failed to request mbox chan %s ret %d\n",
315-
chan_name, ret);
313+
dev_err_probe(dev, ret, "Failed to request mbox chan %s\n",
314+
chan_name);
316315
kfree(chan_name);
317316
return ret;
318317
}

drivers/firmware/imx/scu-pd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = {
180180

181181
/* LVDS SS */
182182
{ "lvds0", IMX_SC_R_LVDS_0, 1, false, 0 },
183+
{ "lvds0-pwm", IMX_SC_R_LVDS_0_PWM_0, 1, false, 0 },
184+
{ "lvds0-lpi2c", IMX_SC_R_LVDS_0_I2C_0, 2, true, 0 },
183185
{ "lvds1", IMX_SC_R_LVDS_1, 1, false, 0 },
186+
{ "lvds1-pwm", IMX_SC_R_LVDS_1_PWM_0, 1, false, 0 },
187+
{ "lvds1-lpi2c", IMX_SC_R_LVDS_1_I2C_0, 2, true, 0 },
184188

185189
/* DC SS */
186190
{ "dc0", IMX_SC_R_DC_0, 1, false, 0 },

drivers/soc/imx/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ config IMX_GPCV2_PM_DOMAINS
1010
default y if SOC_IMX7D
1111

1212
config SOC_IMX8M
13-
bool "i.MX8M SoC family support"
13+
tristate "i.MX8M SoC family support"
1414
depends on ARCH_MXC || COMPILE_TEST
1515
default ARCH_MXC && ARM64
1616
select SOC_BUS

drivers/soc/imx/imx8m-blk-ctrl.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ struct imx8m_blk_ctrl {
3838
struct imx8m_blk_ctrl_domain_data {
3939
const char *name;
4040
const char * const *clk_names;
41-
int num_clks;
4241
const char * const *path_names;
43-
int num_paths;
4442
const char *gpc_name;
43+
int num_clks;
44+
int num_paths;
4545
u32 rst_mask;
4646
u32 clk_mask;
4747

@@ -210,7 +210,7 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
210210
if (!bc->onecell_data.domains)
211211
return -ENOMEM;
212212

213-
bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
213+
bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
214214
if (IS_ERR(bc->bus_power_dev)) {
215215
if (PTR_ERR(bc->bus_power_dev) == -ENODEV)
216216
return dev_err_probe(dev, -EPROBE_DEFER,
@@ -310,6 +310,10 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
310310

311311
dev_set_drvdata(dev, bc);
312312

313+
ret = devm_of_platform_populate(dev);
314+
if (ret)
315+
goto cleanup_provider;
316+
313317
return 0;
314318

315319
cleanup_provider:
@@ -891,3 +895,4 @@ static struct platform_driver imx8m_blk_ctrl_driver = {
891895
},
892896
};
893897
module_platform_driver(imx8m_blk_ctrl_driver);
898+
MODULE_LICENSE("GPL");

drivers/soc/imx/imx8mp-blk-ctrl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static int imx8mp_blk_ctrl_probe(struct platform_device *pdev)
642642
if (!bc->onecell_data.domains)
643643
return -ENOMEM;
644644

645-
bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
645+
bc->bus_power_dev = dev_pm_domain_attach_by_name(dev, "bus");
646646
if (IS_ERR(bc->bus_power_dev))
647647
return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
648648
"failed to attach bus power domain\n");
@@ -852,7 +852,7 @@ static const struct of_device_id imx8mp_blk_ctrl_of_match[] = {
852852
/* Sentinel */
853853
}
854854
};
855-
MODULE_DEVICE_TABLE(of, imx8m_blk_ctrl_of_match);
855+
MODULE_DEVICE_TABLE(of, imx8mp_blk_ctrl_of_match);
856856

857857
static struct platform_driver imx8mp_blk_ctrl_driver = {
858858
.probe = imx8mp_blk_ctrl_probe,
@@ -864,3 +864,4 @@ static struct platform_driver imx8mp_blk_ctrl_driver = {
864864
},
865865
};
866866
module_platform_driver(imx8mp_blk_ctrl_driver);
867+
MODULE_LICENSE("GPL");

drivers/soc/imx/soc-imx8m.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,4 @@ static int __init imx8_soc_init(void)
242242
return ret;
243243
}
244244
device_initcall(imx8_soc_init);
245+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)