[PATCH resend] GPIO PL061: Adding Clk framework support

Viresh KUMAR viresh.kumar at st.com
Mon Jun 21 02:44:28 EDT 2010


On 6/21/2010 12:08 PM, Russell King - ARM Linux wrote:
> On Mon, Jun 21, 2010 at 12:02:23PM +0530, Viresh KUMAR wrote:
>> @@ -56,8 +59,33 @@ struct pl061_gpio {
>>  	void __iomem		*base;
>>  	unsigned		irq_base;
>>  	struct gpio_chip	gc;
>> +	unsigned		usage_count;
>> +	struct clk		*clk;
>>  };
>>  
>> +static int pl061_request(struct gpio_chip *gc, unsigned offset)
>> +{
>> +	struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
>> +
>> +	if (offset >= gc->ngpio)
>> +		return -EINVAL;
>> +
>> +	if (!chip->usage_count)
>> +		clk_enable(chip->clk);
> 
> Clocks are already use-counted.
> 

Yes. This is not required. Can simple call clk_enable and clk_disable.



More information about the linux-arm-kernel mailing list