diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-03-27 09:54:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2018-03-27 09:54:23 -0400 |
commit | 3262b82d0ce66ca9af08ef2cdabc6ce418ebca28 (patch) | |
tree | dcadfdd4c83438afc2ae5a5eaa57f5ba76132865 /drivers | |
parent | 03836dd07f43a17b3681d3fc75ea40833fda49b6 (diff) | |
parent | f842c41adc044e4586dd232c6e889f9d46180fa8 (diff) |
Merge tag 'amlogic-drivers' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/drivers
Pull "Amlogic driver updates for v4.17" from Kevin Hilman:
- socinfo: add more IDs for newer SoC detection
- firmware: update init to use module_platform_driver_probe
- soc: mix. VPU power controller fixes
* tag 'amlogic-drivers' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic:
amlogic: meson-gx-socinfo: Update soc ids
firmware: meson-sm: rework meson_sm_init to use module_platform_driver_probe
meson-gx-socinfo: make local function meson_gx_socinfo_init static
meson-mx-socinfo: Make local function meson_mx_socinfo_init() static
soc: amlogic: meson-gx-pwrc-vpu: fix error on shutdown when domain is powered off
soc: amlogic: meson-gx-pwrc-vpu: don't print error message on probe deferral
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firmware/meson/meson_sm.c | 25 | ||||
-rw-r--r-- | drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 9 | ||||
-rw-r--r-- | drivers/soc/amlogic/meson-gx-socinfo.c | 12 | ||||
-rw-r--r-- | drivers/soc/amlogic/meson-mx-socinfo.c | 2 |
4 files changed, 31 insertions, 17 deletions
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index ff204421117b..0ec2ca87318c 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c | |||
@@ -17,8 +17,10 @@ | |||
17 | #include <linux/arm-smccc.h> | 17 | #include <linux/arm-smccc.h> |
18 | #include <linux/bug.h> | 18 | #include <linux/bug.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/module.h> | ||
20 | #include <linux/of.h> | 21 | #include <linux/of.h> |
21 | #include <linux/of_device.h> | 22 | #include <linux/of_device.h> |
23 | #include <linux/platform_device.h> | ||
22 | #include <linux/printk.h> | 24 | #include <linux/printk.h> |
23 | #include <linux/types.h> | 25 | #include <linux/types.h> |
24 | #include <linux/sizes.h> | 26 | #include <linux/sizes.h> |
@@ -217,21 +219,11 @@ static const struct of_device_id meson_sm_ids[] = { | |||
217 | { /* sentinel */ }, | 219 | { /* sentinel */ }, |
218 | }; | 220 | }; |
219 | 221 | ||
220 | int __init meson_sm_init(void) | 222 | static int __init meson_sm_probe(struct platform_device *pdev) |
221 | { | 223 | { |
222 | const struct meson_sm_chip *chip; | 224 | const struct meson_sm_chip *chip; |
223 | const struct of_device_id *matched_np; | ||
224 | struct device_node *np; | ||
225 | 225 | ||
226 | np = of_find_matching_node_and_match(NULL, meson_sm_ids, &matched_np); | 226 | chip = of_match_device(meson_sm_ids, &pdev->dev)->data; |
227 | if (!np) | ||
228 | return -ENODEV; | ||
229 | |||
230 | chip = matched_np->data; | ||
231 | if (!chip) { | ||
232 | pr_err("unable to setup secure-monitor data\n"); | ||
233 | goto out; | ||
234 | } | ||
235 | 227 | ||
236 | if (chip->cmd_shmem_in_base) { | 228 | if (chip->cmd_shmem_in_base) { |
237 | fw.sm_shmem_in_base = meson_sm_map_shmem(chip->cmd_shmem_in_base, | 229 | fw.sm_shmem_in_base = meson_sm_map_shmem(chip->cmd_shmem_in_base, |
@@ -257,4 +249,11 @@ out_in_base: | |||
257 | out: | 249 | out: |
258 | return -EINVAL; | 250 | return -EINVAL; |
259 | } | 251 | } |
260 | device_initcall(meson_sm_init); | 252 | |
253 | static struct platform_driver meson_sm_driver = { | ||
254 | .driver = { | ||
255 | .name = "meson-sm", | ||
256 | .of_match_table = of_match_ptr(meson_sm_ids), | ||
257 | }, | ||
258 | }; | ||
259 | module_platform_driver_probe(meson_sm_driver, meson_sm_probe); | ||
diff --git a/drivers/soc/amlogic/meson-gx-pwrc-vpu.c b/drivers/soc/amlogic/meson-gx-pwrc-vpu.c index 2bdeebc48901..6289965c42e9 100644 --- a/drivers/soc/amlogic/meson-gx-pwrc-vpu.c +++ b/drivers/soc/amlogic/meson-gx-pwrc-vpu.c | |||
@@ -184,7 +184,8 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev) | |||
184 | 184 | ||
185 | rstc = devm_reset_control_array_get(&pdev->dev, false, false); | 185 | rstc = devm_reset_control_array_get(&pdev->dev, false, false); |
186 | if (IS_ERR(rstc)) { | 186 | if (IS_ERR(rstc)) { |
187 | dev_err(&pdev->dev, "failed to get reset lines\n"); | 187 | if (PTR_ERR(rstc) != -EPROBE_DEFER) |
188 | dev_err(&pdev->dev, "failed to get reset lines\n"); | ||
188 | return PTR_ERR(rstc); | 189 | return PTR_ERR(rstc); |
189 | } | 190 | } |
190 | 191 | ||
@@ -224,7 +225,11 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev) | |||
224 | 225 | ||
225 | static void meson_gx_pwrc_vpu_shutdown(struct platform_device *pdev) | 226 | static void meson_gx_pwrc_vpu_shutdown(struct platform_device *pdev) |
226 | { | 227 | { |
227 | meson_gx_pwrc_vpu_power_off(&vpu_hdmi_pd.genpd); | 228 | bool powered_off; |
229 | |||
230 | powered_off = meson_gx_pwrc_vpu_get_power(&vpu_hdmi_pd); | ||
231 | if (!powered_off) | ||
232 | meson_gx_pwrc_vpu_power_off(&vpu_hdmi_pd.genpd); | ||
228 | } | 233 | } |
229 | 234 | ||
230 | static const struct of_device_id meson_gx_pwrc_vpu_match_table[] = { | 235 | static const struct of_device_id meson_gx_pwrc_vpu_match_table[] = { |
diff --git a/drivers/soc/amlogic/meson-gx-socinfo.c b/drivers/soc/amlogic/meson-gx-socinfo.c index f2d8c3c53ea4..37ea0a1c24c8 100644 --- a/drivers/soc/amlogic/meson-gx-socinfo.c +++ b/drivers/soc/amlogic/meson-gx-socinfo.c | |||
@@ -33,6 +33,10 @@ static const struct meson_gx_soc_id { | |||
33 | { "GXL", 0x21 }, | 33 | { "GXL", 0x21 }, |
34 | { "GXM", 0x22 }, | 34 | { "GXM", 0x22 }, |
35 | { "TXL", 0x23 }, | 35 | { "TXL", 0x23 }, |
36 | { "TXLX", 0x24 }, | ||
37 | { "AXG", 0x25 }, | ||
38 | { "GXLX", 0x26 }, | ||
39 | { "TXHD", 0x27 }, | ||
36 | }; | 40 | }; |
37 | 41 | ||
38 | static const struct meson_gx_package_id { | 42 | static const struct meson_gx_package_id { |
@@ -41,12 +45,18 @@ static const struct meson_gx_package_id { | |||
41 | unsigned int pack_id; | 45 | unsigned int pack_id; |
42 | } soc_packages[] = { | 46 | } soc_packages[] = { |
43 | { "S905", 0x1f, 0 }, | 47 | { "S905", 0x1f, 0 }, |
48 | { "S905H", 0x1f, 0x13 }, | ||
44 | { "S905M", 0x1f, 0x20 }, | 49 | { "S905M", 0x1f, 0x20 }, |
45 | { "S905D", 0x21, 0 }, | 50 | { "S905D", 0x21, 0 }, |
46 | { "S905X", 0x21, 0x80 }, | 51 | { "S905X", 0x21, 0x80 }, |
52 | { "S905W", 0x21, 0xa0 }, | ||
47 | { "S905L", 0x21, 0xc0 }, | 53 | { "S905L", 0x21, 0xc0 }, |
48 | { "S905M2", 0x21, 0xe0 }, | 54 | { "S905M2", 0x21, 0xe0 }, |
49 | { "S912", 0x22, 0 }, | 55 | { "S912", 0x22, 0 }, |
56 | { "962X", 0x24, 0x10 }, | ||
57 | { "962E", 0x24, 0x20 }, | ||
58 | { "A113X", 0x25, 0x37 }, | ||
59 | { "A113D", 0x25, 0x22 }, | ||
50 | }; | 60 | }; |
51 | 61 | ||
52 | static inline unsigned int socinfo_to_major(u32 socinfo) | 62 | static inline unsigned int socinfo_to_major(u32 socinfo) |
@@ -97,7 +107,7 @@ static const char *socinfo_to_soc_id(u32 socinfo) | |||
97 | return "Unknown"; | 107 | return "Unknown"; |
98 | } | 108 | } |
99 | 109 | ||
100 | int __init meson_gx_socinfo_init(void) | 110 | static int __init meson_gx_socinfo_init(void) |
101 | { | 111 | { |
102 | struct soc_device_attribute *soc_dev_attr; | 112 | struct soc_device_attribute *soc_dev_attr; |
103 | struct soc_device *soc_dev; | 113 | struct soc_device *soc_dev; |
diff --git a/drivers/soc/amlogic/meson-mx-socinfo.c b/drivers/soc/amlogic/meson-mx-socinfo.c index 7bfff5ff22a2..78f0f1aeca57 100644 --- a/drivers/soc/amlogic/meson-mx-socinfo.c +++ b/drivers/soc/amlogic/meson-mx-socinfo.c | |||
@@ -104,7 +104,7 @@ static const struct of_device_id meson_mx_socinfo_analog_top_ids[] = { | |||
104 | { /* sentinel */ } | 104 | { /* sentinel */ } |
105 | }; | 105 | }; |
106 | 106 | ||
107 | int __init meson_mx_socinfo_init(void) | 107 | static int __init meson_mx_socinfo_init(void) |
108 | { | 108 | { |
109 | struct soc_device_attribute *soc_dev_attr; | 109 | struct soc_device_attribute *soc_dev_attr; |
110 | struct soc_device *soc_dev; | 110 | struct soc_device *soc_dev; |