Re: [PATCH 2/9] USB: s3c-hsotg: Add regulator support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

On Fri, Feb 10, 2012 at 10:31:11AM +0100, Heiko Stübner wrote:
> > @@ -184,6 +190,36 @@ struct s3c_hsotg_req {
> >  	unsigned char		mapped;
> >  };
> > 
> > +static void s3c_hsotg_regulator_enable(struct s3c_hsotg *hsotg)
> > +{
> > +	mutex_lock(&hsotg->mutex_lock);
> > +	if (!hsotg->enabled) {
> > +		if (hsotg->reg_vusb_d)
> > +			regulator_enable(hsotg->reg_vusb_d);
> > +
> > +		if (hsotg->reg_vusb_a)
> > +			regulator_enable(hsotg->reg_vusb_a);
> > +
> > +			hsotg->enabled = true;
> > +	}
> > +	mutex_unlock(&hsotg->mutex_lock);
> > +}
> > +
> > +static void s3c_hsotg_regulator_disable(struct s3c_hsotg *hsotg)
> > +{
> > +	mutex_lock(&hsotg->mutex_lock);
> > +	if (hsotg->enabled) {
> > +		if (hsotg->reg_vusb_a)
> > +			regulator_disable(hsotg->reg_vusb_a);
> > +
> > +		if (hsotg->reg_vusb_d)
> > +			regulator_disable(hsotg->reg_vusb_d);
> > +
> > +		hsotg->enabled = false;
> > +	}
> > +	mutex_unlock(&hsotg->mutex_lock);
> > +}
> > +
> 
> how about using regulator_bulk_* functions instead of calling each regulator 
> separately - i.e. like in s3c_hsudc.c

yup, I agree here. it will make things neater.

> As Felipe will probably also mention, please add another patch to the series 
> converting the driver to the newer udc_start / udc_stop callbacks while you're 
> at it (essentially also like s3c-hsudc.c)

indeed, thanks for pointing that out ;-)

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux