[PATCH resend] GPIO PL061: Adding Clk framework support

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Jun 21 02:38:48 EDT 2010


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.



More information about the linux-arm-kernel mailing list