[PATCH v6 2/3] rtc: sophgo: add rtc support for Sophgo CV1800 SoC

Krzysztof Kozlowski krzysztof.kozlowski at linaro.org
Mon Jan 15 23:46:12 PST 2024


On 15/01/2024 17:05, Jingbao Qiu wrote:
> Implement the RTC driver for CV1800, which able to provide time alarm
> and calibrate functionality.
> 
> Signed-off-by: Jingbao Qiu <qiujingbao.dlmu at gmail.com>
> ---

> +
> +static int cv1800_rtc_probe(struct platform_device *pdev)
> +{
> +	struct cv1800_rtc_priv *rtc;
> +	uint32_t ctrl_val;
> +	int ret;
> +
> +	rtc = devm_kzalloc(&pdev->dev, sizeof(struct cv1800_rtc_priv),
> +			   GFP_KERNEL);
> +	if (!rtc)
> +		return -ENOMEM;
> +
> +	rtc->dev = &pdev->dev;
> +
> +	rtc->rtc_map = syscon_node_to_regmap(rtc->dev->of_node->parent);
> +	if (IS_ERR(rtc->rtc_map))
> +		return PTR_ERR(rtc->rtc_map);

Why do you take the parent? Your bindings say this device is the syscon,
not parent. Your DTS shows there is no parent syscon! This wasn't tested.

Best regards,
Krzysztof




More information about the linux-riscv mailing list