Re: [PATCH 13/29] mmc: tmio: add regulator support

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

 



On Thu, 3 May 2012, Mark Brown wrote:

> On Thu, May 03, 2012 at 05:05:42PM +0200, Guennadi Liakhovetski wrote:
> 
> > +static void tmio_mmc_set_power(struct tmio_mmc_host *host, struct mmc_ios *ios)
> > +{
> > +	if (!(host->mmc->caps & MMC_CAP_POWER_OFF_CARD))
> > +		return;
> > +
> > +	if (host->vdd)
> > +		/* Errors ignored... */
> > +		mmc_regulator_set_ocr(host->mmc, host->vdd,
> > +				      ios->power_mode ? ios->vdd : 0);
> > +	else if (host->set_pwr)
> > +		host->set_pwr(host->pdev, ios->power_mode != MMC_POWER_OFF);
> > +}
> 
> This looks pretty much identical to the previous code,

Maybe it's because it's been written and is maintained by the same group 
of people? :-)

> should it be being factored out into the core?

Weeeell, it's not a lot of code. We could make this a library function, 
provided by the core, but I don't think it would be very straight forward 
to also automate its calling, thus freeing individual drivers from this 
task. As you can see in these two drivers, one of them turns the card on 
already upon MMC_POWER_UP, the other one only in MMC_POWER_ON. I'm not 
sure off the top of my head why this difference is there, but in any case 
different drivers might have different ideas about this. So, I'm not sure 
whether this micro-optimisation is worth it.

> Or put the regulator bit in the core
> and provide an option to override with manual callbacks if that's
> required.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux