clk: meson: meson8b: use the HHI syscon if available
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 28 Oct 2018 12:08:58 +0000 (13:08 +0100)
committerNeil Armstrong <narmstrong@baylibre.com>
Fri, 23 Nov 2018 14:11:56 +0000 (15:11 +0100)
commitbb6eddd1d28c9c42b1372f023088a8913f3ea7e4
tree41eff4bbdf98ddce5ccf9721a8cd9124170d6601
parent6c763077163d13901ed2d41a67c741a940b695ac
clk: meson: meson8b: use the HHI syscon if available

The clock controller is located in a register range (called "HHI") which
contains more than just registers for the clock controller. Known
consumers of the HHI register range are:
- the clock controller
- a reset controller
- temperature sensor calibration coefficient (TSC) (only on Meson8b and
  Meson8m2)
- HDMI controller

The main reason for using a syscon is the "temperature sensor
calibration coefficient" which has to be set for the built-in temperature
sensor to work correctly. Four TSC bits are located in the SAR ADC's
register space. However on Meson8b and Meson8m2 there is a fifth TSC bit
which is unfortunately located in the HHI register space. To be more
precise, bit 9 of the HHI_DPLL_TOP_0 register (which sits right between
the HHI_SYS_PLL and HHI_VID_PLL registers).

Get the regmap from the parent (HHI syscon) node to support all
functionality of the HHI register range. Backwards compatibility with
old .dtbs is ensured by falling back to parsing the registers just like
before this change.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lkml.kernel.org/r/20181028120859.5735-3-martin.blumenstingl@googlemail.com
drivers/clk/meson/meson8b.c