[PATCH 1/8] PWMSS: Add PWM Subsystem driver for parent<->child relationship

Bedia, Vaibhav vaibhav.bedia at ti.com
Tue Nov 6 01:35:24 EST 2012


On Mon, Nov 05, 2012 at 14:42:22, Philip, Avinash wrote:
[...]
> +pwmss0: pwmss at 48300000 {
> +	compatible = "ti,am33xx-pwmss";
> +	reg = <0x48300000 0x10
> +		0x48300100 0x80
> +		0x48300180 0x80
> +		0x48300200 0x80>;
Do you really need the 4 address ranges here? You eventually do add in
child nodes with other address ranges so isn't the first entry sufficient?
I haven't really looked at the DT details so it is enforced by that let me
know.

[...]
> +
> +#define PWMSS_CLKCONFIG		8
> +

This #def can use a comment.

> +void pwmss_submodule_state_change(struct device *dev, int pos, bool enable)
> +{
> +	struct pwmss_info *info = dev_get_drvdata(dev);
> +	u16 val;
> +
> +	val = readw(info->mmio_base + PWMSS_CLKCONFIG);
> +	if (enable)
> +		val |= 1 << pos;
> +	else
> +		val &= ~(1 << pos);
> +	mutex_lock(&info->pwmss_lock);
> +	writew(val , info->mmio_base + PWMSS_CLKCONFIG);
> +	mutex_unlock(&info->pwmss_lock);
> +}
> +EXPORT_SYMBOL(pwmss_submodule_state_change);

I see a clk_en_ack field in the clock status register. You should be checking that.

[...]

> +
> +MODULE_DESCRIPTION("pwmss driver");
> +MODULE_AUTHOR("Texas Instruments");
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/pwm/tipwmss.h b/drivers/pwm/tipwmss.h
> new file mode 100644
> index 0000000..83fdc29
> --- /dev/null
> +++ b/drivers/pwm/tipwmss.h
> @@ -0,0 +1,8 @@

License text?
 
> +#ifdef CONFIG_PWM_TIPWMSS
> +extern void pwmss_submodule_state_change(struct device *dev, int pos,
> +		bool enable);
> +#else
> +static inline void pwmss_submodule_state_change(struct device *dev, int pos,
> +		bool enable)
> +{}
> +#endif

Regards,
Vaibhav



More information about the linux-arm-kernel mailing list