Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369252
b: refs/heads/master
c: 06e1d1d
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Hartkopp authored and Marc Kleine-Budde committed Apr 16, 2013
1 parent 9389a2d commit 13b751b
Show file tree
Hide file tree
Showing 24 changed files with 298 additions and 285 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: bf7bfd7ff0a8e85c5f469a24c27d4dd1eb756104
refs/heads/master: 06e1d1d71876c75bf4a9d3b310c1b4df34e8be69
8 changes: 6 additions & 2 deletions trunk/drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,10 +1194,14 @@ static int mcp251x_can_resume(struct device *dev)
enable_irq(spi->irq);
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(mcp251x_can_pm_ops, mcp251x_can_suspend,
mcp251x_can_resume);
#define MCP251X_PM_OPS (&mcp251x_can_pm_ops)

#else
#define MCP251X_PM_OPS NULL
#endif

static const struct spi_device_id mcp251x_id_table[] = {
{ "mcp2510", CAN_MCP251X_MCP2510 },
Expand All @@ -1211,7 +1215,7 @@ static struct spi_driver mcp251x_can_driver = {
.driver = {
.name = DEVICE_NAME,
.owner = THIS_MODULE,
.pm = &mcp251x_can_pm_ops,
.pm = MCP251X_PM_OPS,
},

.id_table = mcp251x_id_table,
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/can/sja1000/ems_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ static inline int ems_pci_check_chan(const struct sja1000_priv *priv)
unsigned char res;

/* Make sure SJA1000 is in reset mode */
priv->write_reg(priv, REG_MOD, 1);
priv->write_reg(priv, SJA1000_MOD, 1);

priv->write_reg(priv, REG_CDR, CDR_PELICAN);
priv->write_reg(priv, SJA1000_CDR, CDR_PELICAN);

/* read reset-values */
res = priv->read_reg(priv, REG_CDR);
res = priv->read_reg(priv, SJA1000_CDR);

if (res == CDR_PELICAN)
return 1;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/can/sja1000/ems_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ static irqreturn_t ems_pcmcia_interrupt(int irq, void *dev_id)
static inline int ems_pcmcia_check_chan(struct sja1000_priv *priv)
{
/* Make sure SJA1000 is in reset mode */
ems_pcmcia_write_reg(priv, REG_MOD, 1);
ems_pcmcia_write_reg(priv, REG_CDR, CDR_PELICAN);
ems_pcmcia_write_reg(priv, SJA1000_MOD, 1);
ems_pcmcia_write_reg(priv, SJA1000_CDR, CDR_PELICAN);

/* read reset-values */
if (ems_pcmcia_read_reg(priv, REG_CDR) == CDR_PELICAN)
if (ems_pcmcia_read_reg(priv, SJA1000_CDR) == CDR_PELICAN)
return 1;

return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/can/sja1000/kvaser_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ static int number_of_sja1000_chip(void __iomem *base_addr)
for (i = 0; i < MAX_NO_OF_CHANNELS; i++) {
/* reset chip */
iowrite8(MOD_RM, base_addr +
(i * KVASER_PCI_PORT_BYTES) + REG_MOD);
(i * KVASER_PCI_PORT_BYTES) + SJA1000_MOD);
status = ioread8(base_addr +
(i * KVASER_PCI_PORT_BYTES) + REG_MOD);
(i * KVASER_PCI_PORT_BYTES) + SJA1000_MOD);
/* check reset bit */
if (!(status & MOD_RM))
break;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/can/sja1000/peak_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static void peak_pciec_write_reg(const struct sja1000_priv *priv,
int c = (priv->reg_base - card->reg_base) / PEAK_PCI_CHAN_SIZE;

/* sja1000 register changes control the leds state */
if (port == REG_MOD)
if (port == SJA1000_MOD)
switch (val) {
case MOD_RM:
/* Reset Mode: set led on */
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/can/sja1000/peak_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static void pcan_write_canreg(const struct sja1000_priv *priv, int port, u8 v)
int c = (priv->reg_base - card->ioport_addr) / PCC_CHAN_SIZE;

/* sja1000 register changes control the leds state */
if (port == REG_MOD)
if (port == SJA1000_MOD)
switch (v) {
case MOD_RM:
/* Reset Mode: set led on */
Expand Down Expand Up @@ -509,11 +509,11 @@ static void pcan_free_channels(struct pcan_pccard *card)
static inline int pcan_channel_present(struct sja1000_priv *priv)
{
/* make sure SJA1000 is in reset mode */
pcan_write_canreg(priv, REG_MOD, 1);
pcan_write_canreg(priv, REG_CDR, CDR_PELICAN);
pcan_write_canreg(priv, SJA1000_MOD, 1);
pcan_write_canreg(priv, SJA1000_CDR, CDR_PELICAN);

/* read reset-values */
if (pcan_read_canreg(priv, REG_CDR) == CDR_PELICAN)
if (pcan_read_canreg(priv, SJA1000_CDR) == CDR_PELICAN)
return 1;

return 0;
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/net/can/sja1000/plx_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,20 @@ static inline int plx_pci_check_sja1000(const struct sja1000_priv *priv)
*/
if ((priv->read_reg(priv, REG_CR) & REG_CR_BASICCAN_INITIAL_MASK) ==
REG_CR_BASICCAN_INITIAL &&
(priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_BASICCAN_INITIAL) &&
(priv->read_reg(priv, REG_IR) == REG_IR_BASICCAN_INITIAL))
(priv->read_reg(priv, SJA1000_SR) == REG_SR_BASICCAN_INITIAL) &&
(priv->read_reg(priv, SJA1000_IR) == REG_IR_BASICCAN_INITIAL))
flag = 1;

/* Bring the SJA1000 into the PeliCAN mode*/
priv->write_reg(priv, REG_CDR, CDR_PELICAN);
priv->write_reg(priv, SJA1000_CDR, CDR_PELICAN);

/*
* Check registers after reset in the PeliCAN mode.
* See states on p. 23 of the Datasheet.
*/
if (priv->read_reg(priv, REG_MOD) == REG_MOD_PELICAN_INITIAL &&
priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_PELICAN_INITIAL &&
priv->read_reg(priv, REG_IR) == REG_IR_PELICAN_INITIAL)
if (priv->read_reg(priv, SJA1000_MOD) == REG_MOD_PELICAN_INITIAL &&
priv->read_reg(priv, SJA1000_SR) == REG_SR_PELICAN_INITIAL &&
priv->read_reg(priv, SJA1000_IR) == REG_IR_PELICAN_INITIAL)
return flag;

return 0;
Expand Down
Loading

0 comments on commit 13b751b

Please sign in to comment.