linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* GPIO request failure with PCF pinmux
@ 2012-09-14 20:11 Laurent Pinchart
  2012-09-14 20:36 ` Laurent Pinchart
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Laurent Pinchart @ 2012-09-14 20:11 UTC (permalink / raw)
  To: linux-sh

Hi Paul,

I ran into an issue with GPIO and pinmuxing in the TPU PWM driver.

The driver needs to switch the PWM pin between GPIO and function at runtime. 
To do so, I use the PWM pin GPIO (GPIO_PORT202) and the associated function 
GPIO (GPIO_FN_TPU0TO2_PORT202).

The driver configures the pin as a GPIO output when loaded with

	gpio_request_one(GPIO_PORT202, GPIOF_INIT_LOW);

This results in a call to sh_pfc_gpio_request_enable() followed by a call to 
sh_pfc_reconfig_pin() for GPIO 202. The later changes the pinmux type from 
PINMUX_TYPE_GPIO (2) to PINMUX_TYPE_OUTPUT (3).

I then call gpio_free(GPIO_PORT202) and gpio_request(GPIO_FN_TPU0TO2_PORT202) 
to switch from GPIO to function. The former calls sh_pfc_gpio_disable_free:() 
on GPIO 202.

When I later call gpio_free(GPIO_FN_TPU0TO2_PORT202) and 
gpio_request_one(GPIO_PORT202, GPIOF_INIT_LOW), the call to 
sh_pfc_gpio_request_enable() fails with

pinctrl-sh_pfc pinctrl: Unsupported mux type (3), bailing...
pinctrl-sh_pfc pinctrl-sh_pfc: request() failed for pin 202
pinctrl-sh_pfc pinctrl-sh_pfc: pin-202 (pinctrl-sh_pfc) status -524

You're more familiar with pinmux than I am. Am I doing something wrong, or is 
there a bug in the PFC pinmux implementation ?

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-02 12:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14 20:11 GPIO request failure with PCF pinmux Laurent Pinchart
2012-09-14 20:36 ` Laurent Pinchart
2012-09-18  7:12 ` Paul Mundt
2012-09-18  7:22 ` Paul Mundt
2012-09-19 15:19 ` Laurent Pinchart
2012-09-19 15:33 ` Paul Mundt
2012-10-02 12:24 ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).