Commit Graph
15 Commits
Author SHA1 Message Date
Shawn Guo a53157c21c can: flexcan: adopt pinctrl support
Cc: [email protected]
Signed-off-by: Shawn Guo <[email protected]>
Acked-by: Marc Kleine-Budde <[email protected]>
Acked-by: Dong Aisheng <[email protected]>
2012-05-12 09:43:09 +08:00
David S. Miller d07d4c239b Merge branch 'master' of git://gitorious.org/linux-can/linux-can-next
Conflicts:
	drivers/net/can/usb/ems_usb.c

Minor dev_warn --> netdev_warn conversion conflicts.
2012-02-04 16:42:19 -05:00
Wolfgang Grandegger aabdfd6adb can: replace the dev_dbg/info/err/... with the new netdev_xxx macros
Cc: [email protected]
Cc: Anant Gole <[email protected]>
Cc: Chris Elston <[email protected]>
Cc: Sebastian Haas <[email protected]>
Cc: Matthias Fuchs <[email protected]>
Signed-off-by: Wolfgang Grandegger <[email protected]>
Acked-by: Sebastian Haas <[email protected]>
Acked-by: Mike Frysinger <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
2012-02-03 01:21:26 +01:00
Reuben Dowle 9a12349663 can: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK
Currently the flexcan driver uses hardware local echo. This blindly
echos all transmitted frames to all receiving sockets, regardless what
CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK are set to.

This patch now submits transmitted frames to be echoed in the transmit
complete interrupt, preserving the reference to the sending
socket. This allows the can protocol to correctly handle the local
echo.

Further this patch moves tx_bytes statistic accounting into the tx_complete
handler.

Signed-off-by: Reuben Dowle <[email protected]>
[mkl: move tx_bytes accounting into tx_complete handler; cleanups]
Signed-off-by: Marc Kleine-Budde <[email protected]>
2012-02-03 01:21:25 +01:00
Wolfgang Grandegger 6e9d554fa6 can: flexcan: fix irq flooding by clearing all interrupt sources
As pointed out by Reuben Dowle and Lothar Waßmann, the TWRN_INT,
RWRN_INT, BOFF_INT interrupt sources need to be cleared as well
to avoid interrupt flooding, at least for the Flexcan on i.MX28
SOCs. Furthermore, the interrupts are only cleared, if really one
of those interrupt sources are pending (which is not the case for
rx and tx done).

Cc: Reuben Dowle <[email protected]>
Cc: Lothar Waßmann <[email protected]>
Signed-off-by: Wolfgang Grandegger <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
2012-02-03 00:24:50 +01:00
Linus Torvalds 979ecef5b8 Merge tag 'clk' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
clock management changes for i.MX

Another simple series related to clock management, this time only for
imx.

* tag 'clk' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: mxs: select HAVE_CLK_PREPARE for clock
  clk: add config option HAVE_CLK_PREPARE into Kconfig
  ASoC: mxs-saif: convert to clk_prepare/clk_unprepare
  video: mxsfb: convert to clk_prepare/clk_unprepare
  serial: mxs-auart: convert to clk_prepare/clk_unprepare
  net: flexcan: convert to clk_prepare/clk_unprepare
  mtd: gpmi-lib: convert to clk_prepare/clk_unprepare
  mmc: mxs-mmc: convert to clk_prepare/clk_unprepare
  dma: mxs-dma: convert to clk_prepare/clk_unprepare
  net: fec: add clk_prepare/clk_unprepare
  ARM: mxs: convert platform code to clk_prepare/clk_unprepare
  clk: add helper functions clk_prepare_enable and clk_disable_unprepare

Fix up trivial conflicts in drivers/net/ethernet/freescale/fec.c due to
commit 0ebafefcaa ("net: fec: add clk_prepare/clk_unprepare") clashing
trivially with commit e163cc97f9 ("net/fec: fix the .remove code").
2012-01-09 14:44:15 -08:00
Shawn Guo e735489976 net: flexcan: convert to clk_prepare/clk_unprepare
The patch converts flexcan driver to clk_prepare/clk_unprepare by
using helper functions clk_prepare_enable/clk_disable_unprepare.

Signed-off-by: Shawn Guo <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>
Cc: David S. Miller <[email protected]>
2011-12-28 21:30:47 +08:00
Axel Lin 871d337255 net/can: convert drivers/net/can/* to use module_platform_driver()
This patch converts the drivers in drivers/net/can/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Wolfgang Grandegger <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Bhupesh Sharma <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
Cc: Paul Bolle <[email protected]>
Cc: Kurt Van Dijck <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-11-29 00:25:05 -05:00
[email protected] 97efe9aef1 flexcan: Prefer device tree clock frequency if available.
If our CAN device's device tree node has a clock-frequency property,
then use that value for the can devices clock frequency.  If not, fall
back to asking the platform/mach code for the clock frequency associated
with the flexcan device.

Signed-off-by: Robin Holt <[email protected]>
Acked-by: Wolfgang Grandegger <[email protected]>,
Cc: Kumar Gala <[email protected]>
Cc: Marc Kleine-Budde <[email protected]>,
Cc: U Bhaskar-B22300 <[email protected]>
Cc: Scott Wood <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: [email protected],
Cc: [email protected],
Cc: PPC list <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
2011-08-17 20:36:38 -07:00
[email protected] c8aef4cb78 flexcan: Add of_match to platform_device definition.
On powerpc, the OpenFirmware devices are not matched without specifying
an of_match array.  Introduce that array as that is used for matching
on the Freescale P1010 processor.

Signed-off-by: Robin Holt <[email protected]>
Acked-by: Marc Kleine-Budde <[email protected]>
Acked-by: Wolfgang Grandegger <[email protected]>
Cc: U Bhaskar-B22300 <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: PPC list <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
2011-08-17 20:36:38 -07:00
[email protected] 61e271ee64 flexcan: Abstract off read/write for big/little endian.
Make flexcan driver handle register reads in the appropriate endianess.
This was a basic search and replace and then define some inlines.

Signed-off-by: Robin Holt <[email protected]>
Acked-by: Marc Kleine-Budde <[email protected]>
Acked-by: Wolfgang Grandegger <[email protected]>
Cc: U Bhaskar-B22300 <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: PPC list <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-08-17 20:36:38 -07:00
[email protected] 12732c3083 flexcan: Remove #include <mach/clock.h>
powerpc does not have a mach-####/clock.h.  When testing, I found neither
arm nor powerpc needed the mach/clock.h at all so I removed it.

Signed-off-by: Robin Holt <[email protected]>
Acked-by: Marc Kleine-Budde <[email protected]>
Acked-by: Wolfgang Grandegger <[email protected]>
Cc: U Bhaskar-B22300 <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: PPC list <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-08-17 20:36:38 -07:00
Julia Lawall 2e4ceec4ed drivers/net/can/flexcan.c: add missing clk_put
The failed_get label is used after the call to clk_get has succeeded, so it
should be moved up above the call to clk_put.

The failed_req labels doesn't do anything different than failed_get, so
delete it.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2011-06-02 00:10:01 -07:00
Marc Kleine-Budde 9a27586d3d can: flexcan: fix use after free of priv
The priv is part of the memory allocated by alloc_candev().
This patch moved the free it after last usage of priv.

Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-10-26 10:48:58 -07:00
Marc Kleine-Budde e955cead03 CAN: Add Flexcan CAN controller driver
This core is found on some Freescale SoCs and also some Coldfire
SoCs. Support for Coldfire is missing though at the moment as
they have an older revision of the core which does not have RX FIFO
support.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
Acked-by: Wolfgang Grandegger <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
2010-07-22 18:06:25 +02:00