Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Peng Fan and committed by
Shawn Guo
150019de 4b9ccf04

+17 -3
+17 -3
drivers/firmware/imx/imx-scu-soc.c
··· 78 78 return msg.data.resp.id; 79 79 } 80 80 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 + 81 97 int imx_scu_soc_init(struct device *dev) 82 98 { 83 99 struct soc_device_attribute *soc_dev_attr; ··· 129 113 130 114 /* format soc_id value passed from SCU firmware */ 131 115 val = id & 0x1f; 132 - soc_dev_attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "0x%x", val); 133 - if (!soc_dev_attr->soc_id) 134 - return -ENOMEM; 116 + soc_dev_attr->soc_id = imx_scu_soc_name(val); 135 117 136 118 /* format revision value passed from SCU firmware */ 137 119 val = (id >> 5) & 0xf;