diff options
author | Ricardo Perez Olivares <x0081762@ti.com> | 2010-06-15 17:33:20 -0500 |
---|---|---|
committer | Ricardo Perez Olivares <x0081762@ti.com> | 2010-06-15 17:33:20 -0500 |
commit | 86e732880f30977872ce23b9339fee8630f5f7cc (patch) | |
tree | 192f081c57a6861e0c4b031091c8727c58c486ef | |
parent | 6a1de81ebcf75e9eb77bc42e1593797c722a38a1 (diff) | |
parent | c05c4a28af828fc46fbcbde72920ec405433b56d (diff) |
Merge branch 'omap4_next' of git://dev.omapzoom.org/pub/scm/santosh/kernel-omap4-base into L24.7ti-2.6.34-omap4-L24.7-p1
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/syntm12xx.c | 12 | ||||
-rw-r--r-- | drivers/net/ks8851.c | 46 | ||||
-rw-r--r-- | drivers/serial/omap-serial.c | 5 |
4 files changed, 52 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 5d8406c6a126..2d99afecee64 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -4118,7 +4118,7 @@ static struct omap_hwmod_ocp_if *omap44xx_timer10_slaves[] = { }; static struct omap_hwmod omap44xx_timer10_hwmod = { - .name = "gpt10", + .name = "timer10", .class = &omap44xx_timer_1ms_hwmod_class, .mpu_irqs = omap44xx_timer10_irqs, .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer10_irqs), diff --git a/drivers/input/touchscreen/syntm12xx.c b/drivers/input/touchscreen/syntm12xx.c index b6d0bc168ade..65baebe6d58b 100644 --- a/drivers/input/touchscreen/syntm12xx.c +++ b/drivers/input/touchscreen/syntm12xx.c @@ -1001,8 +1001,10 @@ static void syn_isr_work(struct work_struct *work) mutex_lock(&sd->lock); - if (sd->f_measure) - sd->ts_work = cpu_clock(smp_processor_id()); + if (sd->f_measure) { + sd->ts_work = cpu_clock(get_cpu()); + put_cpu(); + } if (sd->func_descs_valid == 0) { if (sd->failed_inits < MAX_FAILED_INITS) { @@ -1029,7 +1031,8 @@ static void syn_isr_work(struct work_struct *work) out: if (sd->f_measure) { - sd->ts_done = cpu_clock(smp_processor_id()); + sd->ts_done = cpu_clock(get_cpu()); + put_cpu(); syn_recalculate_latency_data(sd); sd->f_measure = 0; } @@ -1046,7 +1049,8 @@ static irqreturn_t syn_isr(int irq, void *data) r = queue_work(sd->wq, &sd->isr_work); if (r) { if (sd->f_measure == 0) { - sd->ts_intr = cpu_clock(smp_processor_id()); + sd->ts_intr = cpu_clock(get_cpu()); + put_cpu(); sd->f_measure = 1; } disable_irq_nosync(gpio_to_irq(sd->gpio_intr)); diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c index c4bca266b336..c940c9674bb5 100644 --- a/drivers/net/ks8851.c +++ b/drivers/net/ks8851.c @@ -76,6 +76,7 @@ union ks8851_tx_hdr { * @msg_enable: The message flags controlling driver output (see ethtool). * @fid: Incrementing frame id tag. * @rc_ier: Cached copy of KS_IER. + * @rc_ccr: Cached copy of KS_CCR. * @rc_rxqcr: Cached copy of KS_RXQCR. * * The @lock ensures that the chip is protected when certain operations are @@ -107,6 +108,7 @@ struct ks8851_net { u16 rc_ier; u16 rc_rxqcr; + u16 rc_ccr; struct mii_if_info mii; struct ks8851_rxctrl rxctrl; @@ -367,21 +369,47 @@ static int ks8851_write_mac_addr(struct net_device *dev) } /** + * ks8851_read_mac_addr - read mac address from device registers + * @dev: The network device + * + * Update our copy of the KS8851 MAC address from the registers of @dev. +*/ +static void ks8851_read_mac_addr(struct net_device *dev) +{ + struct ks8851_net *ks = netdev_priv(dev); + int i; + + mutex_lock(&ks->lock); + + for (i = 0; i < ETH_ALEN; i++) + dev->dev_addr[i] = ks8851_rdreg8(ks, KS_MAR(i)); + + mutex_unlock(&ks->lock); +} + +/** * ks8851_init_mac - initialise the mac address * @ks: The device structure * * Get or create the initial mac address for the device and then set that - * into the station address register. Currently we assume that the device - * does not have a valid mac address in it, and so we use random_ether_addr() + * into the station address register. If there is an EEPROM present, then + * we try that. If no valid mac address is found we use random_ether_addr() * to create a new one. - * - * In future, the driver should check to see if the device has an EEPROM - * attached and whether that has a valid ethernet address in it. */ static void ks8851_init_mac(struct ks8851_net *ks) { struct net_device *dev = ks->netdev; + /* first, try reading what we've got already */ + if (ks->rc_ccr & CCR_EEPROM) { + ks8851_read_mac_addr(dev); + if (is_valid_ether_addr(dev->dev_addr)) + return; + + ks_err(ks, "invalid mac address read %pM\n", + dev->dev_addr); + } + random_ether_addr(dev->dev_addr); ks8851_write_mac_addr(dev); } @@ -1283,6 +1311,9 @@ static int __devinit ks8851_probe(struct spi_device *spi) goto err_id; } + /* cache the contents of the CCR register for EEPROM, etc. */ + ks->rc_ccr = ks8851_rdreg16(ks, KS_CCR); + ks8851_read_selftest(ks); ks8851_init_mac(ks); @@ -1299,9 +1330,10 @@ static int __devinit ks8851_probe(struct spi_device *spi) goto err_netdev; } - dev_info(&spi->dev, "revision %d, MAC %pM, IRQ %d\n", + dev_info(&spi->dev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n", CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)), - ndev->dev_addr, ndev->irq); + ndev->dev_addr, ndev->irq, + ks->rc_ccr & CCR_EEPROM ? "has" : "no"); return 0; diff --git a/drivers/serial/omap-serial.c b/drivers/serial/omap-serial.c index b40a9118e750..d69a5edb6105 100644 --- a/drivers/serial/omap-serial.c +++ b/drivers/serial/omap-serial.c @@ -353,7 +353,7 @@ static inline irqreturn_t serial_omap_irq(int irq, void *dev_id) spin_lock_irqsave(&up->port.lock, flags); lsr = serial_in(up, UART_LSR); - if (iir & UART_IER_RLSI) { + if (iir & UART_IIR_RLSI) { if (!up->use_dma) { if (lsr & UART_LSR_DR) receive_chars(up, &lsr); @@ -917,6 +917,7 @@ serial_omap_console_write(struct console *co, const char *s, struct uart_omap_port *up = serial_omap_console_ports[co->index]; unsigned int ier; + spin_lock(&up->port.lock); /* * First save the IER then disable the interrupts */ @@ -940,6 +941,8 @@ serial_omap_console_write(struct console *co, const char *s, */ if (up->msr_saved_flags) check_modem_status(up); + + spin_unlock(&up->port.lock); } static int __init |