OSDN Git Service

iio: adc: aspeed: Fix the calculate error of clock.
authorBilly Tsai <billy_tsai@aspeedtech.com>
Wed, 22 Sep 2021 08:15:16 +0000 (16:15 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:27:32 +0000 (08:27 +0100)
commit90f9647753de30708da3891296812c4ec97cb404
treebea3a0ced27b5d2539213a29da57d03004b90610
parent1b5ceb55fec2aac929672eb8e24f98a12a10f695
iio: adc: aspeed: Fix the calculate error of clock.

The ADC clock formula is
ast2400/2500:
ADC clock period = PCLK * 2 * (ADC0C[31:17] + 1) * (ADC0C[9:0] + 1)
ast2600:
ADC clock period = PCLK * 2 * (ADC0C[15:0] + 1)
They all have one fixed divided 2 and the legacy driver didn't handle it.
This patch register the fixed factory clock device as the parent of ADC
clock scaler to fix this issue.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Link: https://lore.kernel.org/r/20210922081520.30580-8-billy_tsai@aspeedtech.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/aspeed_adc.c