mfd: syscon: Decouple syscon interface from platform devices
mfd: syscon: Decouple syscon interface from platform devices

Currently a syscon entity can be only registered directly through a
platform device that binds to a dedicated syscon driver. However in
certain use cases it is desirable to make a device used with another
driver a syscon interface provider.

For example, certain SoCs (e.g. Exynos) contain system controller
blocks which perform various functions such as power domain control,
CPU power management, low power mode control, but in addition contain
certain IP integration glue, such as various signal masks,
coprocessor power control, etc. In such case, there is a need to have
a dedicated driver for such system controller but also share registers
with other drivers. The latter is where the syscon interface is helpful.

In case of DT based platforms, this patch decouples syscon object from
syscon platform driver, and allows to create syscon objects first time
when it is required by calling of syscon_regmap_lookup_by APIs and keep
a list of such syscon objects along with syscon provider device_nodes
and regmap handles.

For non-DT based platforms, this patch keeps syscon platform driver
structure so that syscon can be probed and such non-DT based drivers
can use syscon_regmap_lookup_by_pdev API and access regmap handles.
Once all users of "syscon_regmap_lookup_by_pdev" migrated to DT based,
we can completely remove platform driver of syscon, and keep only helper
functions to get regmap handles.

Suggested-by: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Suggested-by: Tomasz Figa <69861c78e6f8ec8c6fbfd1c06050c87cda6b23eb@gmail.com>
Tested-by: Vivek Gautam <5c6bd423a2e3d98ebdccbc25654ed1942ee0af9f@samsung.com>
Tested-by: Javier Martinez Canillas <039000e09e601bba70626bd0fbe59654c9cf8cac@collabora.co.uk>
Signed-off-by: Pankaj Dubey <dbd64b4eb34fd9d2e5efbeef9cb6d7571f2fe5db@samsung.com>
Reviewed-by: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Tested-by: Heiko Stuebner <9ab5f52a1ca0bcf4f70d6d9008e02f6134b5b8f2@sntech.de>
Reviewed-by: Heiko Stuebner <9ab5f52a1ca0bcf4f70d6d9008e02f6134b5b8f2@sntech.de>
Signed-off-by: Lee Jones <630e34333487a351a857f6b705e04d30b37c1629@linaro.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs