[PATCH v10 2/4] pwm: opencores: Add PWM driver support

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Jan 4 14:40:48 PST 2024


Hello again,

On Fri, Dec 22, 2023 at 05:45:46PM +0800, William Qiu wrote:
> +static const struct ocores_pwm_data jh7100_pwm_data = {
> +	.get_ch_base = starfive_jh71x0_get_ch_base,
> +};
> +
> +static const struct ocores_pwm_data jh7110_pwm_data = {
> +	.get_ch_base = starfive_jh71x0_get_ch_base,
> +};
> +
> +static const struct of_device_id ocores_pwm_of_match[] = {
> +	{ .compatible = "opencores,pwm-v1" },
> +	{ .compatible = "starfive,jh7100-pwm", .data = &jh7100_pwm_data},
> +	{ .compatible = "starfive,jh7110-pwm", .data = &jh7110_pwm_data},
> +	{ /* sentinel */ }

Looking at the binding

	compatible = "opencores,pwm-v1";

isn't a valid configuration. If that is indeed the case and you always
have either starfive,jh7100-pwm or starfive,jh7110-pwm, you can drop the
logic to only use starfive_jh71x0_get_ch_base conditionally.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20240104/665fc0be/attachment.sig>


More information about the linux-riscv mailing list