soc: samsung: exynos-chipid: convert to driver and merge exynos-asv
authorKrzysztof Kozlowski <krzk@kernel.org>
Mon, 7 Dec 2020 18:54:57 +0000 (19:54 +0100)
committerKrzysztof Kozlowski <krzk@kernel.org>
Sun, 3 Jan 2021 16:08:45 +0000 (17:08 +0100)
commit352bfbb3e0230c96b2bce00d2ac3f0de303cc7b6
tree4dceab7b8a6908399c857195f85ffcdeb6e867f9
parent4561560dfb4f847a0b327d48bdd1f45bf1b6261f
soc: samsung: exynos-chipid: convert to driver and merge exynos-asv

The Exynos Chip ID driver on Exynos SoCs has so far only informational
purpose - to expose the SoC device in sysfs.  No other drivers depend on
it so there is really no benefit of initializing it early.

The code would be the most flexible if converted to a regular driver.
However there is already another driver - Exynos ASV (Adaptive Supply
Voltage) - which binds to the device node of Chip ID.

The solution is to convert the Exynos Chip ID to a built in driver and
merge the Exynos ASV into it.

This has several benefits:
1. Although the Exynos ASV driver binds to a device node present in all
   Exynos DTS (generic compatible), it fails to probe except on the
   supported ones (only Exynos5422).  This means that the regular boot
   process has a planned/normal device probe failure.

   Merging the ASV into Chip ID will remove this probe failure because
   the final driver will always bind, just with disabled ASV features.

2. Allows to use dev_info() as the SoC bus is present (since
   core_initcall).

3. Could speed things up because of execution of Chip ID code in a SMP
   environment (after bringing up secondary CPUs, unlike early_initcall),
   This reduces the amount of work to be done early, when the kernel has
   to bring up critical devices.

5. Makes the Chip ID code defer-probe friendly,

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201207190517.262051-5-krzk@kernel.org
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
arch/arm/mach-exynos/Kconfig
drivers/soc/samsung/Kconfig
drivers/soc/samsung/Makefile
drivers/soc/samsung/exynos-asv.c
drivers/soc/samsung/exynos-asv.h
drivers/soc/samsung/exynos-chipid.c