aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-12-24 16:00:37 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-12-24 16:00:37 -0500
commitd3c7e1ab043abd7706db4fbccf327df9e62f7990 (patch)
tree793aec926c57da1e364e04163199262364c627b0
parentdfe80f63293ece364795c2e87805882c9ec3a266 (diff)
parent4bdac7da5237170b1392f39ebee99d235043fad8 (diff)
Merge branch 'merge' of git://git.secretlab.ca/git/linux-2.6
* 'merge' of git://git.secretlab.ca/git/linux-2.6: spi/mpc52xx-spi: fix annotation for remove()-pointer spi/fsl_espi: fix wrong setting of the address in the command buffer spi/fsl_espi: change the read behaviour of the SPIRF of/i2c: Fix request module by alias powerpc/mpc5200: include fs.h in mpc52xx_gpt.c
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_gpt.c1
-rw-r--r--drivers/of/of_i2c.c2
-rw-r--r--drivers/spi/mpc52xx_spi.c2
-rw-r--r--drivers/spi/spi_fsl_espi.c35
4 files changed, 28 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
index fea833e18ad..e0d703c7fdf 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c
@@ -63,6 +63,7 @@
63#include <linux/of_gpio.h> 63#include <linux/of_gpio.h>
64#include <linux/kernel.h> 64#include <linux/kernel.h>
65#include <linux/slab.h> 65#include <linux/slab.h>
66#include <linux/fs.h>
66#include <linux/watchdog.h> 67#include <linux/watchdog.h>
67#include <linux/miscdevice.h> 68#include <linux/miscdevice.h>
68#include <linux/uaccess.h> 69#include <linux/uaccess.h>
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c
index c85d3c7421f..f37fbeb66a4 100644
--- a/drivers/of/of_i2c.c
+++ b/drivers/of/of_i2c.c
@@ -61,7 +61,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
61 info.of_node = of_node_get(node); 61 info.of_node = of_node_get(node);
62 info.archdata = &dev_ad; 62 info.archdata = &dev_ad;
63 63
64 request_module("%s", info.type); 64 request_module("%s%s", I2C_MODULE_PREFIX, info.type);
65 65
66 result = i2c_new_device(adap, &info); 66 result = i2c_new_device(adap, &info);
67 if (result == NULL) { 67 if (result == NULL) {
diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c
index ec9f0b1bf86..84439f65560 100644
--- a/drivers/spi/mpc52xx_spi.c
+++ b/drivers/spi/mpc52xx_spi.c
@@ -563,7 +563,7 @@ static struct of_platform_driver mpc52xx_spi_of_driver = {
563 .of_match_table = mpc52xx_spi_match, 563 .of_match_table = mpc52xx_spi_match,
564 }, 564 },
565 .probe = mpc52xx_spi_probe, 565 .probe = mpc52xx_spi_probe,
566 .remove = __exit_p(mpc52xx_spi_remove), 566 .remove = __devexit_p(mpc52xx_spi_remove),
567}; 567};
568 568
569static int __init mpc52xx_spi_init(void) 569static int __init mpc52xx_spi_init(void)
diff --git a/drivers/spi/spi_fsl_espi.c b/drivers/spi/spi_fsl_espi.c
index e3b4f645196..a99e2333b94 100644
--- a/drivers/spi/spi_fsl_espi.c
+++ b/drivers/spi/spi_fsl_espi.c
@@ -258,18 +258,18 @@ static int fsl_espi_bufs(struct spi_device *spi, struct spi_transfer *t)
258 return mpc8xxx_spi->count; 258 return mpc8xxx_spi->count;
259} 259}
260 260
261static void fsl_espi_addr2cmd(unsigned int addr, u8 *cmd) 261static inline void fsl_espi_addr2cmd(unsigned int addr, u8 *cmd)
262{ 262{
263 if (cmd[1] && cmd[2] && cmd[3]) { 263 if (cmd) {
264 cmd[1] = (u8)(addr >> 16); 264 cmd[1] = (u8)(addr >> 16);
265 cmd[2] = (u8)(addr >> 8); 265 cmd[2] = (u8)(addr >> 8);
266 cmd[3] = (u8)(addr >> 0); 266 cmd[3] = (u8)(addr >> 0);
267 } 267 }
268} 268}
269 269
270static unsigned int fsl_espi_cmd2addr(u8 *cmd) 270static inline unsigned int fsl_espi_cmd2addr(u8 *cmd)
271{ 271{
272 if (cmd[1] && cmd[2] && cmd[3]) 272 if (cmd)
273 return cmd[1] << 16 | cmd[2] << 8 | cmd[3] << 0; 273 return cmd[1] << 16 | cmd[2] << 8 | cmd[3] << 0;
274 274
275 return 0; 275 return 0;
@@ -395,9 +395,11 @@ static void fsl_espi_rw_trans(struct spi_message *m,
395 } 395 }
396 } 396 }
397 397
398 addr = fsl_espi_cmd2addr(local_buf); 398 if (pos > 0) {
399 addr += pos; 399 addr = fsl_espi_cmd2addr(local_buf);
400 fsl_espi_addr2cmd(addr, local_buf); 400 addr += pos;
401 fsl_espi_addr2cmd(addr, local_buf);
402 }
401 403
402 espi_trans->n_tx = n_tx; 404 espi_trans->n_tx = n_tx;
403 espi_trans->n_rx = trans_len; 405 espi_trans->n_rx = trans_len;
@@ -507,16 +509,29 @@ void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events)
507 509
508 /* We need handle RX first */ 510 /* We need handle RX first */
509 if (events & SPIE_NE) { 511 if (events & SPIE_NE) {
510 u32 rx_data; 512 u32 rx_data, tmp;
513 u8 rx_data_8;
511 514
512 /* Spin until RX is done */ 515 /* Spin until RX is done */
513 while (SPIE_RXCNT(events) < min(4, mspi->len)) { 516 while (SPIE_RXCNT(events) < min(4, mspi->len)) {
514 cpu_relax(); 517 cpu_relax();
515 events = mpc8xxx_spi_read_reg(&reg_base->event); 518 events = mpc8xxx_spi_read_reg(&reg_base->event);
516 } 519 }
517 mspi->len -= 4;
518 520
519 rx_data = mpc8xxx_spi_read_reg(&reg_base->receive); 521 if (mspi->len >= 4) {
522 rx_data = mpc8xxx_spi_read_reg(&reg_base->receive);
523 } else {
524 tmp = mspi->len;
525 rx_data = 0;
526 while (tmp--) {
527 rx_data_8 = in_8((u8 *)&reg_base->receive);
528 rx_data |= (rx_data_8 << (tmp * 8));
529 }
530
531 rx_data <<= (4 - mspi->len) * 8;
532 }
533
534 mspi->len -= 4;
520 535
521 if (mspi->rx) 536 if (mspi->rx)
522 mspi->get_rx(rx_data, mspi); 537 mspi->get_rx(rx_data, mspi);