Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341625
b: refs/heads/master
c: 83a9d19
h: refs/heads/master
i:
  341623: 1d78e61
v: v3
  • Loading branch information
David S. Miller committed Nov 28, 2012
1 parent 8d5ba70 commit de74eb5
Show file tree
Hide file tree
Showing 47 changed files with 6,399 additions and 3,775 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79d38f7d6cf545ff838dd5227869f3916d1d100d
refs/heads/master: 83a9d197c7ecd1913e84aaa982a7215666b656f2
2 changes: 1 addition & 1 deletion trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
* anyway (it holds no special properties of the bond device),
* so we can change it without calling change_active_interface()
*/
if (!bond->curr_active_slave)
if (!bond->curr_active_slave && new_slave->link == BOND_LINK_UP)
bond->curr_active_slave = new_slave;

break;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/can/at91_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,7 @@ static const struct platform_device_id at91_can_id_table[] = {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(platform, at91_can_id_table);

static struct platform_driver at91_can_driver = {
.probe = at91_can_probe,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/can/bfin_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,3 +691,4 @@ module_platform_driver(bfin_can_driver);
MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Blackfin on-chip CAN netdevice driver");
MODULE_ALIAS("platform:" DRV_NAME);
12 changes: 12 additions & 0 deletions trunk/drivers/net/can/c_can/c_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

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)
{
return (priv->tx_next & C_CAN_NEXT_MSG_OBJ_MASK) +
Expand Down Expand Up @@ -1090,6 +1096,7 @@ static int c_can_open(struct net_device *dev)
struct c_can_priv *priv = netdev_priv(dev);

c_can_pm_runtime_get_sync(priv);
c_can_reset_ram(priv, true);

/* open the can device */
err = open_candev(dev);
Expand Down Expand Up @@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev)
exit_irq_fail:
close_candev(dev);
exit_open_fail:
c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);
return err;
}
Expand All @@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev)
c_can_stop(dev);
free_irq(dev->irq, dev);
close_candev(dev);

c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);

return 0;
Expand Down Expand Up @@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev)

c_can_stop(dev);

c_can_reset_ram(priv, false);
c_can_pm_runtime_put_sync(priv);

return 0;
Expand All @@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev)
WARN_ON(priv->type != BOSCH_D_CAN);

c_can_pm_runtime_get_sync(priv);
c_can_reset_ram(priv, true);

/* Clear PDR and INIT bits */
val = priv->read_reg(priv, C_CAN_CTRL_EX_REG);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/can/c_can/c_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ struct c_can_priv {
void *priv; /* for board-specific data */
u16 irqstatus;
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);
Expand Down
30 changes: 29 additions & 1 deletion trunk/drivers/net/can/c_can/c_can_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

#include "c_can.h"

#define CAN_RAMINIT_START_MASK(i) (1 << (i))

/*
* 16-bit c_can registers can be arranged differently in the memory
* architecture of different implementations. For example: 16-bit
Expand Down Expand Up @@ -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]);
}

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[] = {
[BOSCH_C_CAN_PLATFORM] = {
.name = KBUILD_MODNAME,
Expand All @@ -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[] = {
{ .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] },
{ .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, c_can_of_table);

static int __devinit c_can_plat_probe(struct platform_device *pdev)
{
Expand All @@ -99,7 +115,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
const struct of_device_id *match;
const struct platform_device_id *id;
struct pinctrl *pinctrl;
struct resource *mem;
struct resource *mem, *res;
int irq;
struct clk *clk;

Expand Down Expand Up @@ -178,6 +194,18 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
priv->read_reg = c_can_plat_read_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;
default:
ret = -EINVAL;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/can/cc770/cc770_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" DRV_NAME);

#define CC770_PLATFORM_CAN_CLOCK 16000000

Expand Down Expand Up @@ -258,6 +259,7 @@ static struct of_device_id __devinitdata cc770_platform_table[] = {
{.compatible = "intc,82527"}, /* AN82527 from Intel CP */
{},
};
MODULE_DEVICE_TABLE(of, cc770_platform_table);

static struct platform_driver cc770_platform_driver = {
.driver = {
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/can/flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,11 +979,13 @@ static const struct of_device_id flexcan_of_match[] = {
{ .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, flexcan_of_match);

static const struct platform_device_id flexcan_id_table[] = {
{ .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(platform, flexcan_id_table);

static int __devinit flexcan_probe(struct platform_device *pdev)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/can/mscan/mpc5xxx_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ static const struct of_device_id __devinitconst mpc5xxx_can_table[] = {
{ .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, },
{},
};
MODULE_DEVICE_TABLE(of, mpc5xxx_can_table);

static struct platform_driver mpc5xxx_can_driver = {
.driver = {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/can/sja1000/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ config CAN_SJA1000_PLATFORM

config CAN_SJA1000_OF_PLATFORM
tristate "Generic OF Platform Bus based SJA1000 driver"
depends on PPC_OF
depends on OF
---help---
This driver adds support for the SJA1000 chips connected to
the OpenFirmware "platform bus" found on embedded systems with
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/can/sja1000/sja1000_of_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <linux/can/dev.h>

#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <asm/prom.h>

#include "sja1000.h"
Expand All @@ -59,13 +61,13 @@ MODULE_LICENSE("GPL v2");

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,
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)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/can/sja1000/sja1000_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus");
MODULE_ALIAS("platform:" DRV_NAME);
MODULE_LICENSE("GPL v2");

static u8 sp_read_reg8(const struct sja1000_priv *priv, int reg)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/can/ti_hecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,4 @@ module_platform_driver(ti_hecc_driver);
MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION(DRV_DESC);
MODULE_ALIAS("platform:" DRV_NAME);
29 changes: 29 additions & 0 deletions trunk/drivers/net/can/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ config CAN_ESD_USB2
This driver supports the CAN-USB/2 interface
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
tristate "PEAK PCAN-USB/USB Pro interfaces"
---help---
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/can/usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/

ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
Loading

0 comments on commit de74eb5

Please sign in to comment.