Commit f81d3af9 authored by David S. Miller's avatar David S. Miller

Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next

Marc Kleine-Budde says:

====================
this is pull request is for net-next. Contains a patch by Andreas
Larsson, which enables the sja1000 of driver to work under sparc.
AnilKumar Ch contributed a patch to improve the c_can support under
omap, Olivier Sobrie's patch brings support for the CAN/USB dongles
from Kvaser. In a bunch of patches by me missing MODULE_ALIAS and/or
MODULE_DEVICE_TABLE entries were added to the CAN drivers.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4e591b93 fc8f40b1
...@@ -1372,6 +1372,7 @@ static const struct platform_device_id at91_can_id_table[] = { ...@@ -1372,6 +1372,7 @@ static const struct platform_device_id at91_can_id_table[] = {
/* sentinel */ /* sentinel */
} }
}; };
MODULE_DEVICE_TABLE(platform, at91_can_id_table);
static struct platform_driver at91_can_driver = { static struct platform_driver at91_can_driver = {
.probe = at91_can_probe, .probe = at91_can_probe,
......
...@@ -691,3 +691,4 @@ module_platform_driver(bfin_can_driver); ...@@ -691,3 +691,4 @@ module_platform_driver(bfin_can_driver);
MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Blackfin on-chip CAN netdevice driver"); MODULE_DESCRIPTION("Blackfin on-chip CAN netdevice driver");
MODULE_ALIAS("platform:" DRV_NAME);
...@@ -233,6 +233,12 @@ static inline void c_can_pm_runtime_put_sync(const struct c_can_priv *priv) ...@@ -233,6 +233,12 @@ static inline void c_can_pm_runtime_put_sync(const struct c_can_priv *priv)
pm_runtime_put_sync(priv->device); pm_runtime_put_sync(priv->device);
} }
static inline void c_can_reset_ram(const struct c_can_priv *priv, bool enable)
{
if (priv->raminit)
priv->raminit(priv, enable);
}
static inline int get_tx_next_msg_obj(const struct c_can_priv *priv) static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)
{ {
return (priv->tx_next & C_CAN_NEXT_MSG_OBJ_MASK) + return (priv->tx_next & C_CAN_NEXT_MSG_OBJ_MASK) +
...@@ -1090,6 +1096,7 @@ static int c_can_open(struct net_device *dev) ...@@ -1090,6 +1096,7 @@ static int c_can_open(struct net_device *dev)
struct c_can_priv *priv = netdev_priv(dev); struct c_can_priv *priv = netdev_priv(dev);
c_can_pm_runtime_get_sync(priv); c_can_pm_runtime_get_sync(priv);
c_can_reset_ram(priv, true);
/* open the can device */ /* open the can device */
err = open_candev(dev); err = open_candev(dev);
...@@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev) ...@@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev)
exit_irq_fail: exit_irq_fail:
close_candev(dev); close_candev(dev);
exit_open_fail: exit_open_fail:
c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv); c_can_pm_runtime_put_sync(priv);
return err; return err;
} }
...@@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev) ...@@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev)
c_can_stop(dev); c_can_stop(dev);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
close_candev(dev); close_candev(dev);
c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv); c_can_pm_runtime_put_sync(priv);
return 0; return 0;
...@@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev) ...@@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev)
c_can_stop(dev); c_can_stop(dev);
c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv); c_can_pm_runtime_put_sync(priv);
return 0; return 0;
...@@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev) ...@@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev)
WARN_ON(priv->type != BOSCH_D_CAN); WARN_ON(priv->type != BOSCH_D_CAN);
c_can_pm_runtime_get_sync(priv); c_can_pm_runtime_get_sync(priv);
c_can_reset_ram(priv, true);
/* Clear PDR and INIT bits */ /* Clear PDR and INIT bits */
val = priv->read_reg(priv, C_CAN_CTRL_EX_REG); val = priv->read_reg(priv, C_CAN_CTRL_EX_REG);
......
...@@ -169,6 +169,9 @@ struct c_can_priv { ...@@ -169,6 +169,9 @@ struct c_can_priv {
void *priv; /* for board-specific data */ void *priv; /* for board-specific data */
u16 irqstatus; u16 irqstatus;
enum c_can_dev_id type; enum c_can_dev_id type;
u32 __iomem *raminit_ctrlreg;
unsigned int instance;
void (*raminit) (const struct c_can_priv *priv, bool enable);
}; };
struct net_device *alloc_c_can_dev(void); struct net_device *alloc_c_can_dev(void);
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include "c_can.h" #include "c_can.h"
#define CAN_RAMINIT_START_MASK(i) (1 << (i))
/* /*
* 16-bit c_can registers can be arranged differently in the memory * 16-bit c_can registers can be arranged differently in the memory
* architecture of different implementations. For example: 16-bit * architecture of different implementations. For example: 16-bit
...@@ -68,6 +70,18 @@ static void c_can_plat_write_reg_aligned_to_32bit(struct c_can_priv *priv, ...@@ -68,6 +70,18 @@ static void c_can_plat_write_reg_aligned_to_32bit(struct c_can_priv *priv,
writew(val, priv->base + 2 * priv->regs[index]); writew(val, priv->base + 2 * priv->regs[index]);
} }
static void c_can_hw_raminit(const struct c_can_priv *priv, bool enable)
{
u32 val;
val = readl(priv->raminit_ctrlreg);
if (enable)
val |= CAN_RAMINIT_START_MASK(priv->instance);
else
val &= ~CAN_RAMINIT_START_MASK(priv->instance);
writel(val, priv->raminit_ctrlreg);
}
static struct platform_device_id c_can_id_table[] = { static struct platform_device_id c_can_id_table[] = {
[BOSCH_C_CAN_PLATFORM] = { [BOSCH_C_CAN_PLATFORM] = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
...@@ -83,12 +97,14 @@ static struct platform_device_id c_can_id_table[] = { ...@@ -83,12 +97,14 @@ static struct platform_device_id c_can_id_table[] = {
}, { }, {
} }
}; };
MODULE_DEVICE_TABLE(platform, c_can_id_table);
static const struct of_device_id c_can_of_table[] = { static const struct of_device_id c_can_of_table[] = {
{ .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] }, { .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] },
{ .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] }, { .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] },
{ /* sentinel */ }, { /* sentinel */ },
}; };
MODULE_DEVICE_TABLE(of, c_can_of_table);
static int __devinit c_can_plat_probe(struct platform_device *pdev) static int __devinit c_can_plat_probe(struct platform_device *pdev)
{ {
...@@ -99,7 +115,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) ...@@ -99,7 +115,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
const struct of_device_id *match; const struct of_device_id *match;
const struct platform_device_id *id; const struct platform_device_id *id;
struct pinctrl *pinctrl; struct pinctrl *pinctrl;
struct resource *mem; struct resource *mem, *res;
int irq; int irq;
struct clk *clk; struct clk *clk;
...@@ -178,6 +194,18 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) ...@@ -178,6 +194,18 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES; priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
priv->read_reg = c_can_plat_read_reg_aligned_to_16bit; priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
priv->write_reg = c_can_plat_write_reg_aligned_to_16bit; priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
if (pdev->dev.of_node)
priv->instance = of_alias_get_id(pdev->dev.of_node, "d_can");
else
priv->instance = pdev->id;
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv->raminit_ctrlreg = devm_request_and_ioremap(&pdev->dev, res);
if (!priv->raminit_ctrlreg || priv->instance < 0)
dev_info(&pdev->dev, "control memory is not used for raminit\n");
else
priv->raminit = c_can_hw_raminit;
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus"); MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" DRV_NAME);
#define CC770_PLATFORM_CAN_CLOCK 16000000 #define CC770_PLATFORM_CAN_CLOCK 16000000
...@@ -258,6 +259,7 @@ static struct of_device_id __devinitdata cc770_platform_table[] = { ...@@ -258,6 +259,7 @@ static struct of_device_id __devinitdata cc770_platform_table[] = {
{.compatible = "intc,82527"}, /* AN82527 from Intel CP */ {.compatible = "intc,82527"}, /* AN82527 from Intel CP */
{}, {},
}; };
MODULE_DEVICE_TABLE(of, cc770_platform_table);
static struct platform_driver cc770_platform_driver = { static struct platform_driver cc770_platform_driver = {
.driver = { .driver = {
......
...@@ -979,11 +979,13 @@ static const struct of_device_id flexcan_of_match[] = { ...@@ -979,11 +979,13 @@ static const struct of_device_id flexcan_of_match[] = {
{ .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
{ /* sentinel */ }, { /* sentinel */ },
}; };
MODULE_DEVICE_TABLE(of, flexcan_of_match);
static const struct platform_device_id flexcan_id_table[] = { static const struct platform_device_id flexcan_id_table[] = {
{ .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, }, { .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, },
{ /* sentinel */ }, { /* sentinel */ },
}; };
MODULE_DEVICE_TABLE(platform, flexcan_id_table);
static int __devinit flexcan_probe(struct platform_device *pdev) static int __devinit flexcan_probe(struct platform_device *pdev)
{ {
......
...@@ -396,6 +396,7 @@ static const struct of_device_id __devinitconst mpc5xxx_can_table[] = { ...@@ -396,6 +396,7 @@ static const struct of_device_id __devinitconst mpc5xxx_can_table[] = {
{ .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, }, { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, mpc5xxx_can_table);
static struct platform_driver mpc5xxx_can_driver = { static struct platform_driver mpc5xxx_can_driver = {
.driver = { .driver = {
......
...@@ -21,7 +21,7 @@ config CAN_SJA1000_PLATFORM ...@@ -21,7 +21,7 @@ config CAN_SJA1000_PLATFORM
config CAN_SJA1000_OF_PLATFORM config CAN_SJA1000_OF_PLATFORM
tristate "Generic OF Platform Bus based SJA1000 driver" tristate "Generic OF Platform Bus based SJA1000 driver"
depends on PPC_OF depends on OF
---help--- ---help---
This driver adds support for the SJA1000 chips connected to This driver adds support for the SJA1000 chips connected to
the OpenFirmware "platform bus" found on embedded systems with the OpenFirmware "platform bus" found on embedded systems with
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include <linux/can/dev.h> #include <linux/can/dev.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <asm/prom.h> #include <asm/prom.h>
#include "sja1000.h" #include "sja1000.h"
...@@ -59,13 +61,13 @@ MODULE_LICENSE("GPL v2"); ...@@ -59,13 +61,13 @@ MODULE_LICENSE("GPL v2");
static u8 sja1000_ofp_read_reg(const struct sja1000_priv *priv, int reg) static u8 sja1000_ofp_read_reg(const struct sja1000_priv *priv, int reg)
{ {
return in_8(priv->reg_base + reg); return ioread8(priv->reg_base + reg);
} }
static void sja1000_ofp_write_reg(const struct sja1000_priv *priv, static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
int reg, u8 val) int reg, u8 val)
{ {
out_8(priv->reg_base + reg, val); iowrite8(val, priv->reg_base + reg);
} }
static int __devexit sja1000_ofp_remove(struct platform_device *ofdev) static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>"); MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus"); MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus");
MODULE_ALIAS("platform:" DRV_NAME);
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
static u8 sp_read_reg8(const struct sja1000_priv *priv, int reg) static u8 sp_read_reg8(const struct sja1000_priv *priv, int reg)
......
...@@ -1055,3 +1055,4 @@ module_platform_driver(ti_hecc_driver); ...@@ -1055,3 +1055,4 @@ module_platform_driver(ti_hecc_driver);
MODULE_AUTHOR("Anant Gole <anantgole@ti.com>"); MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION(DRV_DESC); MODULE_DESCRIPTION(DRV_DESC);
MODULE_ALIAS("platform:" DRV_NAME);
...@@ -13,6 +13,35 @@ config CAN_ESD_USB2 ...@@ -13,6 +13,35 @@ config CAN_ESD_USB2
This driver supports the CAN-USB/2 interface This driver supports the CAN-USB/2 interface
from esd electronic system design gmbh (http://www.esd.eu). from esd electronic system design gmbh (http://www.esd.eu).
config CAN_KVASER_USB
tristate "Kvaser CAN/USB interface"
---help---
This driver adds support for Kvaser CAN/USB devices like Kvaser
Leaf Light.
The driver gives support for the following devices:
- Kvaser Leaf Light
- Kvaser Leaf Professional HS
- Kvaser Leaf SemiPro HS
- Kvaser Leaf Professional LS
- Kvaser Leaf Professional SWC
- Kvaser Leaf Professional LIN
- Kvaser Leaf SemiPro LS
- Kvaser Leaf SemiPro SWC
- Kvaser Memorator II HS/HS
- Kvaser USBcan Professional HS/HS
- Kvaser Leaf Light GI
- Kvaser Leaf Professional HS (OBD-II connector)
- Kvaser Memorator Professional HS/LS
- Kvaser Leaf Light "China"
- Kvaser BlackBird SemiPro
- Kvaser USBcan R
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called kvaser_usb.
config CAN_PEAK_USB config CAN_PEAK_USB
tristate "PEAK PCAN-USB/USB Pro interfaces" tristate "PEAK PCAN-USB/USB Pro interfaces"
---help--- ---help---
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/ obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/
ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment