Lines Matching +full:revision +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0
7 * Exynos - CHIP ID support
12 * Samsung Exynos SoC Adaptive Supply Voltage and Chip ID support
23 #include <linux/soc/samsung/exynos-chipid.h>
26 #include "exynos-asv.h"
29 unsigned int rev_reg; /* revision register offset */
30 unsigned int main_rev_shift; /* main revision offset in rev_reg */
31 unsigned int sub_rev_shift; /* sub revision offset in rev_reg */
36 u32 revision; member
41 unsigned int id; member
44 /* Compatible with: samsung,exynos4210-chipid */
46 { "EXYNOS4210", 0x43200000 }, /* EVT0 revision */
58 /* Compatible with: samsung,exynos850-chipid */
70 if (product_id == soc_ids[i].id) in product_id_to_soc_id()
85 soc_info->product_id = val & EXYNOS_MASK; in exynos_chipid_get_chipid_info()
87 if (data->rev_reg != EXYNOS_CHIPID_REG_PRO_ID) { in exynos_chipid_get_chipid_info()
88 ret = regmap_read(regmap, data->rev_reg, &val); in exynos_chipid_get_chipid_info()
92 main_rev = (val >> data->main_rev_shift) & EXYNOS_REV_PART_MASK; in exynos_chipid_get_chipid_info()
93 sub_rev = (val >> data->sub_rev_shift) & EXYNOS_REV_PART_MASK; in exynos_chipid_get_chipid_info()
94 soc_info->revision = (main_rev << EXYNOS_REV_PART_SHIFT) | sub_rev; in exynos_chipid_get_chipid_info()
109 drv_data = of_device_get_match_data(&pdev->dev); in exynos_chipid_probe()
111 return -EINVAL; in exynos_chipid_probe()
113 regmap = device_node_to_regmap(pdev->dev.of_node); in exynos_chipid_probe()
121 soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr), in exynos_chipid_probe()
124 return -ENOMEM; in exynos_chipid_probe()
126 soc_dev_attr->family = "Samsung Exynos"; in exynos_chipid_probe()
129 of_property_read_string(root, "model", &soc_dev_attr->machine); in exynos_chipid_probe()
132 soc_dev_attr->revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, in exynos_chipid_probe()
133 "%x", soc_info.revision); in exynos_chipid_probe()
134 soc_dev_attr->soc_id = product_id_to_soc_id(soc_info.product_id); in exynos_chipid_probe()
135 if (!soc_dev_attr->soc_id) { in exynos_chipid_probe()
137 return -ENODEV; in exynos_chipid_probe()
145 ret = exynos_asv_init(&pdev->dev, regmap); in exynos_chipid_probe()
151 dev_info(&pdev->dev, "Exynos: CPU[%s] PRO_ID[0x%x] REV[0x%x] Detected\n", in exynos_chipid_probe()
152 soc_dev_attr->soc_id, soc_info.product_id, soc_info.revision); in exynos_chipid_probe()
183 .compatible = "samsung,exynos4210-chipid",
186 .compatible = "samsung,exynos850-chipid",
195 .name = "exynos-chipid",