]> git.baikalelectronics.ru Git - kernel.git/commit
can: c_can: Fix default pinmux glitch at init
authorJ.D. Schroeder <jay.schroeder@garmin.com>
Wed, 8 Jul 2015 11:38:12 +0000 (14:38 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 12 Jul 2015 18:57:42 +0000 (20:57 +0200)
commitfd6b3a664a02b5636a80e86142c35e993f8a6415
treecbf4fecd8b6d144d98f053d3645a681e4412664a
parentd00c455a79dc87db0cf90214c4a33937143839ff
can: c_can: Fix default pinmux glitch at init

The previous change e2cf4f3c306c (net: can: c_can: Disable pins when CAN
interface is down) causes a slight glitch on the pinctrl settings when used.
Since commit 3e0f755 (drivers/pinctrl: grab default handles from device core),
the device core will automatically set the default pins. This causes the pins
to be momentarily set to the default and then to the sleep state in
register_c_can_dev(). By adding an optional "enable" state, boards can set the
default pin state to be disabled and avoid the glitch when the switch from
default to sleep first occurs. If the "enable" state is not available
c_can_pinctrl_select_state() falls back to using the "default" pinctrl state.

[Roger Q] - Forward port to v4.2 and use pinctrl_get_select().

Signed-off-by: J.D. Schroeder <jay.schroeder@garmin.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can.c