Skip to content

Commit 150019d

Browse files
MrVanShawn Guo
authored andcommitted
firmware: imx: scu: use soc name for soc_id
Same as soc-imx8m and soc-imx driver, use soc name for soc_id which is user friendly. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 4b9ccf0 commit 150019d

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

drivers/firmware/imx/imx-scu-soc.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ static int imx_scu_soc_id(void)
7878
return msg.data.resp.id;
7979
}
8080

81+
static const char *imx_scu_soc_name(u32 id)
82+
{
83+
switch (id) {
84+
case 0x1:
85+
return "i.MX8QM";
86+
case 0x2:
87+
return "i.MX8QXP";
88+
case 0xe:
89+
return "i.MX8DXL";
90+
default:
91+
break;
92+
}
93+
94+
return "NULL";
95+
}
96+
8197
int imx_scu_soc_init(struct device *dev)
8298
{
8399
struct soc_device_attribute *soc_dev_attr;
@@ -113,9 +129,7 @@ int imx_scu_soc_init(struct device *dev)
113129

114130
/* format soc_id value passed from SCU firmware */
115131
val = id & 0x1f;
116-
soc_dev_attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "0x%x", val);
117-
if (!soc_dev_attr->soc_id)
118-
return -ENOMEM;
132+
soc_dev_attr->soc_id = imx_scu_soc_name(val);
119133

120134
/* format revision value passed from SCU firmware */
121135
val = (id >> 5) & 0xf;

0 commit comments

Comments
 (0)