[PATCH] orinoco: Remove EXPERIMENTAL mark from PLX_HERMES, TMD_HERMES and PCI_HERMES.

2005-09-06 Thread Linux Kernel Mailing List
tree 522f94abb0250c656459fb297ac04a91b246f29a
parent c89cc225f72ec240196733872fa1a9eb9d8335ac
author Pavel Roskin [EMAIL PROTECTED] Fri, 02 Sep 2005 04:07:52 -0400
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:14:07 -0400

[PATCH] orinoco: Remove EXPERIMENTAL mark from PLX_HERMES, TMD_HERMES and 
PCI_HERMES.

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]

diff-tree ceb6695092be8dcdfe2dec6ee5097d613011489d (from 
6b39374a27eb4be7e9d82145ae270ba02ea90dc8)
Author: Pavel Roskin [EMAIL PROTECTED]
Date:   Thu Sep 1 14:50:10 2005 -0400

Remove EXPERIMENTAL mark from PLX_HERMES, TMD_HERMES and PCI_HERMES.

Those drivers have been used for a long time, and there have been very
few problem reports.
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/Kconfig |   18 ++
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -289,8 +289,8 @@ config APPLE_AIRPORT
  a non-standard interface
 
 config PLX_HERMES
-   tristate Hermes in PLX9052 based PCI adaptor support (Netgear MA301 
etc.) (EXPERIMENTAL)
-   depends on PCI  HERMES  EXPERIMENTAL
+   tristate Hermes in PLX9052 based PCI adaptor support (Netgear MA301 
etc.)
+   depends on PCI  HERMES
help
  Enable support for PCMCIA cards supported by the Hermes (aka
  orinoco) driver when used in PLX9052 based PCI adaptors.  These
@@ -299,12 +299,9 @@ config PLX_HERMES
  802.11b PCMCIA cards can be used in desktop machines.  The Netgear
  MA301 is such an adaptor.
 
- Support for these adaptors is so far still incomplete and buggy.
- You have been warned.
-
 config TMD_HERMES
-   tristate Hermes in TMD7160 based PCI adaptor support (EXPERIMENTAL)
-   depends on PCI  HERMES  EXPERIMENTAL
+   tristate Hermes in TMD7160 based PCI adaptor support
+   depends on PCI  HERMES
help
  Enable support for PCMCIA cards supported by the Hermes (aka
  orinoco) driver when used in TMD7160 based PCI adaptors.  These
@@ -312,12 +309,9 @@ config TMD_HERMES
  PCI - PCMCIA bridge.  Several vendors sell such adaptors so that
  802.11b PCMCIA cards can be used in desktop machines.
 
- Support for these adaptors is so far still incomplete and buggy.
- You have been warned.
-
 config PCI_HERMES
-   tristate Prism 2.5 PCI 802.11b adaptor support (EXPERIMENTAL)
-   depends on PCI  HERMES  EXPERIMENTAL
+   tristate Prism 2.5 PCI 802.11b adaptor support
+   depends on PCI  HERMES
help
  Enable support for PCI and mini-PCI 802.11b wireless NICs based on
  the Prism 2.5 chipset.  These are true PCI cards, not the 802.11b
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mv643xx: Disable per port bandwidth limits

2005-09-06 Thread Linux Kernel Mailing List
tree d4ec74fdf3f80711af27ea76d5c7da8d6524c64e
parent b111ceb68ac4c44d1a6fa697c55f267fa09b1058
author Dale Farnsworth [EMAIL PROTECTED] Sat, 03 Sep 2005 02:34:35 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:08:30 -0400

[PATCH] mv643xx: Disable per port bandwidth limits

The mv643xx chips support per port bandwith limits.  This patch
disables the bandwidth limits by clearing the MTU register.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/mv643xx_eth.c |3 +++
 1 files changed, 3 insertions(+)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1866,6 +1866,9 @@ static void eth_port_start(struct mv643x
/* Enable port Rx. */
mv_write(MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num),
mp-port_rx_queue_command);
+
+   /* Disable port bandwidth limits by clearing MTU register */
+   mv_write(MV643XX_ETH_MAXIMUM_TRANSMIT_UNIT(port_num), 0);
 }
 
 /*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Remove unused DYN_TICK_* macros

2005-09-06 Thread Linux Kernel Mailing List
tree 2d6a392adfd2e3ed19ff5a7f8d628d0afeee45aa
parent 664399e1fbdceb18da9c9c5534dedd62327c63e8
author Russell King [EMAIL PROTECTED] Mon, 05 Sep 2005 10:21:04 +0100
committer Russell King [EMAIL PROTECTED] Mon, 05 Sep 2005 10:21:04 +0100

[ARM] Remove unused DYN_TICK_* macros

Neither DYN_TICK_SKIPPING nor DYN_TICK_SUITABLE are used on ARM.
Remove them.

Signed-off-by: Russell King [EMAIL PROTECTED]

 include/asm-arm/mach/time.h |2 --
 1 files changed, 2 deletions(-)

diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -47,9 +47,7 @@ struct sys_timer {
 
 #ifdef CONFIG_NO_IDLE_HZ
 
-#define DYN_TICK_SKIPPING  (1  2)
 #define DYN_TICK_ENABLED   (1  1)
-#define DYN_TICK_SUITABLE  (1  0)
 
 struct dyn_tick_timer {
unsigned intstate;  /* Current state */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] (2/7) iomem annotations (e1000)

2005-09-06 Thread Linux Kernel Mailing List
tree 8d1053e9c70f7a5fefdcdfb29a46756b365e1e57
parent 91fb4c964c606e63ce0d0d31814728d62a5de9bc
author [EMAIL PROTECTED] [EMAIL PROTECTED] Mon, 05 Sep 2005 03:25:53 +0100
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 01:57:23 -0400

[PATCH] (2/7) iomem annotations (e1000)

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/e1000/e1000_hw.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1270,7 +1270,7 @@ struct e1000_hw_stats {
 
 /* Structure containing variables used by the shared code (e1000_hw.c) */
 struct e1000_hw {
-uint8_t *hw_addr;
+uint8_t __iomem *hw_addr;
 uint8_t *flash_address;
 e1000_mac_type mac_type;
 e1000_phy_type phy_type;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 2876/1: N30 - remove task to toggle USB D+ line

2005-09-06 Thread Linux Kernel Mailing List
tree 8a3dacda10e5bfc1f69c5dde8b920f175ec592d5
parent 9d88347758c58ee5b4ac9cd594b96eaafa5e08bb
author Ben Dooks [EMAIL PROTECTED] Mon, 05 Sep 2005 20:47:53 +0100
committer Russell King [EMAIL PROTECTED] Mon, 05 Sep 2005 20:47:53 +0100

[ARM] 2876/1: N30 - remove task to toggle USB D+ line

Patch from Ben Dooks

The n30 machine file is using a kernel thread to change the
state of the USB D+ pull-up resistor, which is not the proper
way to do this. Once the usb-gadget support for the 24xx is
merge, the proper access method will be added.
This patch also removes the problem of using HZ for the
msleep calls, from Nishanth Aravamudan.

Signed-off-by: Ben Dooks [EMAIL PROTECTED]
Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/mach-s3c2410/mach-n30.c |   30 ++
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -110,34 +110,24 @@ void __init n30_init_irq(void)
s3c24xx_init_irq();
 }
 
-
-static int n30_usbstart_thread(void *unused)
-{
-   /* Turn off suspend on both USB ports, and switch the
-* selectable USB port to USB device mode. */
-   writel(readl(S3C2410_MISCCR)  ~0x3008, S3C2410_MISCCR);
-
-   /* Turn off the D+ pull up for 3 seconds so that the USB host
-* at the other end will do a rescan of the USB bus.  */
-   s3c2410_gpio_setpin(S3C2410_GPB3, 0);
-
-   msleep_interruptible(3*HZ);
-
-   s3c2410_gpio_setpin(S3C2410_GPB3, 1);
-
-   return 0;
-}
-
+/* GPB3 is the line that controls the pull-up for the USB D+ line */
 
 void __init n30_init(void)
 {
s3c_device_i2c.dev.platform_data = n30_i2ccfg;
 
-   kthread_run(n30_usbstart_thread, NULL, n30_usbstart);
+   /* Turn off suspend on both USB ports, and switch the
+* selectable USB port to USB device mode. */
+
+   s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
+ S3C2410_MISCCR_USBSUSPND0 |
+ S3C2410_MISCCR_USBSUSPND1, 0x0);
 }
 
 MACHINE_START(N30, Acer-N30)
-   /* Maintainer: Christer Weinigel [EMAIL PROTECTED], Ben Dooks [EMAIL 
PROTECTED] */
+   /* Maintainer: Christer Weinigel [EMAIL PROTECTED],
+   Ben Dooks [EMAIL PROTECTED]
+   */
.phys_ram   = S3C2410_SDRAM_PA,
.phys_io= S3C2410_PA_UART,
.io_pg_offst= (((u32)S3C24XX_VA_UART)  18)  0xfffc,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sis190: make 10Mbps the default when handling the StationControl register

2005-09-06 Thread Linux Kernel Mailing List
tree 167513c1c9fb84d3ff3bedca626a21a3ab018e8f
parent 900eb9d69252cf91d42f6a87fc80b1c5518dbff1
author Francois Romieu [EMAIL PROTECTED] Sat, 03 Sep 2005 00:56:16 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:06:53 -0400

[PATCH] sis190: make 10Mbps the default when handling the StationControl 
register

This patch does three things:
- widen the access to the StationControl register (note the SIS_W16
  versus SIS_W32 change);
- default to 10Mbps half duplex when the LPA can not be evaluated
  (reg31-ctl is identical for both). It can be argued that it makes
  sense as the lowest common denominator when everything else failed.
  Btw it works better than the current code. :o)
- remove some enums: they do not document anymore.

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/sis190.c |   58 ++-
 1 files changed, 21 insertions(+), 37 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -179,14 +179,6 @@ enum sis190_register_content {
TxInterFrameGapShift= 24,
TxDMAShift  = 8, /* DMA burst value (0-7) is shift this 
many bits */
 
-   /* StationControl */
-   _1000bpsF   = 0x1c00,
-   _1000bpsH   = 0x0c00,
-   _100bpsF= 0x1800,
-   _100bpsH= 0x0800,
-   _10bpsF = 0x1400,
-   _10bpsH = 0x0400,
-
LinkStatus  = 0x02, // unused
FullDup = 0x01, // unused
 
@@ -886,11 +878,6 @@ static void sis190_hw_start(struct net_d
 
SIS_W32(IntrStatus, 0x);
SIS_W32(IntrMask, 0x0);
-   /*
-* Default is 100Mbps.
-* A bit strange: 100Mbps is 0x1801 elsewhere -- FR 2005/06/09
-*/
-   SIS_W16(StationControl, 0x1901);
SIS_W32(GMIIControl, 0x0);
SIS_W32(TxMacControl, 0x60);
SIS_W16(RxMacControl, 0x02);
@@ -937,29 +924,23 @@ static void sis190_phy_task(void * data)
/* Rejoice ! */
struct {
int val;
+   u32 ctl;
const char *msg;
-   u16 ctl;
} reg31[] = {
-   { LPA_1000XFULL | LPA_SLCT,
-   1000 Mbps Full Duplex,
-   0x01 | _1000bpsF },
-   { LPA_1000XHALF | LPA_SLCT,
-   1000 Mbps Half Duplex,
-   0x01 | _1000bpsH },
-   { LPA_100FULL,
-   100 Mbps Full Duplex,
-   0x01 | _100bpsF },
-   { LPA_100HALF,
-   100 Mbps Half Duplex,
-   0x01 | _100bpsH },
-   { LPA_10FULL,
-   10 Mbps Full Duplex,
-   0x01 | _10bpsF },
-   { LPA_10HALF,
-   10 Mbps Half Duplex,
-   0x01 | _10bpsH },
-   { 0, unknown, 0x }
-   }, *p;
+   { LPA_1000XFULL | LPA_SLCT, 0x07000c00 | 0x1000,
+   1000 Mbps Full Duplex },
+   { LPA_1000XHALF | LPA_SLCT, 0x07000c00,
+   1000 Mbps Half Duplex },
+   { LPA_100FULL, 0x04000800 | 0x1000,
+   100 Mbps Full Duplex },
+   { LPA_100HALF, 0x04000800,
+   100 Mbps Half Duplex },
+   { LPA_10FULL, 0x04000400 | 0x1000,
+   10 Mbps Full Duplex },
+   { LPA_10HALF, 0x04000400,
+   10 Mbps Half Duplex },
+   { 0, 0x04000400, unknown }
+   }, *p;
u16 adv;
 
val = mdio_read(ioaddr, phy_id, 0x1f);
@@ -972,12 +953,15 @@ static void sis190_phy_task(void * data)
 
val = adv;
 
-   for (p = reg31; p-ctl; p++) {
+   for (p = reg31; p-val; p++) {
if ((val  p-val) == p-val)
break;
}
-   if (p-ctl)
-   SIS_W16(StationControl, p-ctl);
+
+   p-ctl |= SIS_R32(StationControl)  ~0x0f001c00;
+
+   SIS_W32(StationControl, p-ctl);
+
net_link(tp, KERN_INFO %s: link on %s mode.\n, dev-name,
 p-msg);
netif_carrier_on(dev);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  

[PATCH] sis190: basic sis191 support

2005-09-06 Thread Linux Kernel Mailing List
tree f22e5bff47b87d30af3a63b467c99521f7fe5bba
parent c3d6f1f24cf3fdfdad3bff631349dc2aef06c8df
author Francois Romieu [EMAIL PROTECTED] Sat, 03 Sep 2005 00:57:51 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:06:53 -0400

[PATCH] sis190: basic sis191 support

The sis191 is the gigabit brother of the sis190. SiS's driver suggests
that the register set is backward compatible: this should hopefully
give a basic driver.

The device should allow the usual features from a modern ethernet
adapter (802.1q, SG, Jumbo frames, TSO, checksum offload). So far
the relevant register layout is not documented. SiS's driver does
not provide these features either (at least not for Linux).

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/Kconfig  |7 +--
 drivers/net/sis190.c |6 +++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1924,12 +1924,15 @@ config R8169_VLAN
  If in doubt, say Y.
 
 config SIS190
-   tristate SiS190 gigabit ethernet support
+   tristate SiS190/SiS191 gigabit ethernet support
depends on PCI
select CRC32
select MII
---help---
- Say Y here if you have a SiS 190 PCI Gigabit Ethernet adapter.
+ Say Y here if you have a SiS 190 PCI Fast Ethernet adapter or
+ a SiS 191 PCI Gigabit Ethernet adapter. Both are expected to
+ appear in lan on motherboard designs which are based on SiS 965
+ and SiS 966 south bridge.
 
  To compile this driver as a module, choose M here: the module
  will be called sis190.  This is recommended.
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -331,14 +331,14 @@ static struct mii_chip_info {
 
 const static struct {
const char *name;
-   u8 version; /* depend on docs */
-   u32 RxConfigMask;   /* clear the bits supported by this chip */
 } sis_chip_info[] = {
-   { DRV_NAME, 0x00, 0xff7e1880, },
+   { SiS 190 PCI Fast Ethernet adapter },
+   { SiS 191 PCI Gigabit Ethernet adapter },
 };
 
 static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
+   { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
{ 0, },
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sis190: RGMII Tx internal delay fiddling

2005-09-06 Thread Linux Kernel Mailing List
tree af58a41345f99a23137b1d0d868787d03b483c99
parent 6614a6dc6ebba4d3ca0ba5ea023b61a7d22ab00b
author Francois Romieu [EMAIL PROTECTED] Sat, 03 Sep 2005 00:56:57 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:06:53 -0400

[PATCH] sis190: RGMII Tx internal delay fiddling

Don't ask.
The patch is based on SiS's GPLed driver.

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/sis190.c |   19 +--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -273,7 +273,8 @@ enum sis190_eeprom_address {
 
 enum sis190_feature {
F_HAS_RGMII = 1,
-   F_PHY_88E   = 2
+   F_PHY_88E   = 2,
+   F_PHY_BCM5461   = 4
 };
 
 struct sis190_private {
@@ -321,7 +322,7 @@ static struct mii_chip_info {
 unsigned int type;
u32 feature;
 } mii_chip_table[] = {
-   { Broadcom PHY BCM5461, { 0x0020, 0x60c0 }, LAN, 0 },
+   { Broadcom PHY BCM5461, { 0x0020, 0x60c0 }, LAN, F_PHY_BCM5461 },
{ Agere PHY ET1101B,{ 0x0282, 0xf010 }, LAN, 0 },
{ Marvell PHY 88E,  { 0x0141, 0x0cc0 }, LAN, F_PHY_88E },
{ Realtek PHY RTL8201,  { 0x, 0x8200 }, LAN, 0 },
@@ -960,8 +961,22 @@ static void sis190_phy_task(void * data)
 
p-ctl |= SIS_R32(StationControl)  ~0x0f001c00;
 
+   if ((tp-features  F_HAS_RGMII) 
+   (tp-features  F_PHY_BCM5461)) {
+   // Set Tx Delay in RGMII mode.
+   mdio_write(ioaddr, phy_id, 0x18, 0xf1c7);
+   udelay(200);
+   mdio_write(ioaddr, phy_id, 0x1c, 0x8c00);
+   p-ctl |= 0x0300;
+   }
+
SIS_W32(StationControl, p-ctl);
 
+   if (tp-features  F_HAS_RGMII) {
+   SIS_W32(RGDelay, 0x0441);
+   SIS_W32(RGDelay, 0x0440);
+   }
+
net_link(tp, KERN_INFO %s: link on %s mode.\n, dev-name,
 p-msg);
netif_carrier_on(dev);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sis190: unmask the link change events

2005-09-06 Thread Linux Kernel Mailing List
tree d0fd757ee52ae17c1ef3af8d60e3af0e19e99001
parent dc85dec68880176c8ba05f68218a161964cada46
author Francois Romieu [EMAIL PROTECTED] Sat, 03 Sep 2005 00:54:25 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:06:52 -0400

[PATCH] sis190: unmask the link change events

link changes reporting does not work when the driver masks its irq event

Signed-off-by: Arnaud Patard [EMAIL PROTECTED]
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/sis190.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -360,7 +360,7 @@ MODULE_VERSION(DRV_VERSION);
 MODULE_LICENSE(GPL);
 
 static const u32 sis190_intr_mask =
-   RxQEmpty | RxQInt | TxQ1Int | TxQ0Int | RxHalt | TxHalt;
+   RxQEmpty | RxQInt | TxQ1Int | TxQ0Int | RxHalt | TxHalt | LinkChange;
 
 /*
  * Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
@@ -923,6 +923,7 @@ static void sis190_phy_task(void * data)
 BMSR_ANEGCOMPLETE)) {
net_link(tp, KERN_WARNING %s: PHY reset until link up.\n,
 dev-name);
+   netif_carrier_off(dev);
mdio_write(ioaddr, phy_id, MII_BMCR, val | BMCR_RESET);
mod_timer(tp-timer, jiffies + SIS190_PHY_TIMEOUT);
} else {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] (4/7) missing include (uli526x)

2005-09-06 Thread Linux Kernel Mailing List
tree cc47695ba15ad223da296b61f478203364fe63ca
parent 509a2671a445345d917d8828b2cb3f5743af6093
author [EMAIL PROTECTED] [EMAIL PROTECTED] Mon, 05 Sep 2005 03:26:03 +0100
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 01:57:23 -0400

[PATCH] (4/7) missing include (uli526x)

added missing include of dma-mapping.h, removed bogus ptrace.h (what the
hell was it doing there, in the first place?)

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/tulip/uli526x.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -21,7 +21,6 @@
 #include linux/kernel.h
 #include linux/string.h
 #include linux/timer.h
-#include linux/ptrace.h
 #include linux/errno.h
 #include linux/ioport.h
 #include linux/slab.h
@@ -34,6 +33,7 @@
 #include linux/skbuff.h
 #include linux/delay.h
 #include linux/spinlock.h
+#include linux/dma-mapping.h
 
 #include asm/processor.h
 #include asm/bitops.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] (7/7) __user annotations (ethtool)

2005-09-06 Thread Linux Kernel Mailing List
tree a54a24c67650a0f216c35bbffd9469bb75f0
parent 843684a24eb7b261461d8bc1aa723c23732ecb94
author [EMAIL PROTECTED] [EMAIL PROTECTED] Mon, 05 Sep 2005 03:26:18 +0100
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 01:57:23 -0400

[PATCH] (7/7) __user annotations (ethtool)

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 net/core/ethtool.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -695,7 +695,7 @@ static int ethtool_get_stats(struct net_
return ret;
 }
 
-static int ethtool_get_perm_addr(struct net_device *dev, void *useraddr)
+static int ethtool_get_perm_addr(struct net_device *dev, void __user *useraddr)
 {
struct ethtool_perm_addr epaddr;
u8 *data;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] orinoco: New driver - orinoco_nortel.

2005-09-06 Thread Linux Kernel Mailing List
tree e32ab69ce85ed4a4a3f5358e99e4c67f241c5abb
parent 8c09e16bd8f816f19cea0920430a1ac26478fcf6
author Pavel Roskin [EMAIL PROTECTED] Fri, 02 Sep 2005 04:08:56 -0400
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:14:08 -0400

[PATCH] orinoco: New driver - orinoco_nortel.

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]

diff-tree dce61aef99ceb57370b70222dc34d788666c0ac3 (from 
ceb6695092be8dcdfe2dec6ee5097d613011489d)
Author: Pavel Roskin [EMAIL PROTECTED]
Date:   Thu Sep 1 15:50:55 2005 -0400

New driver - orinoco_nortel.

This is a driver for Nortel emobility PCI adaptors, which consist of an
Orinoco compatible PCMCIA card and a simple PCI-to-PCMCIA bridge.  The
driver initializes the device and uses Orinoco core driver for actual
wireless networking.
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/Kconfig  |9 
 drivers/net/wireless/Makefile |1 
 drivers/net/wireless/orinoco_nortel.c |  324 ++
 3 files changed, 334 insertions(+)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -309,6 +309,15 @@ config TMD_HERMES
  PCI - PCMCIA bridge.  Several vendors sell such adaptors so that
  802.11b PCMCIA cards can be used in desktop machines.
 
+config NORTEL_HERMES
+   tristate Nortel emobility PCI adaptor support
+   depends on PCI  HERMES
+   help
+ Enable support for PCMCIA cards supported by the Hermes (aka
+ orinoco) driver when used in Nortel emobility PCI adaptors.  These
+ adaptors are not full PCMCIA controllers, but act as a more limited
+ PCI - PCMCIA bridge.
+
 config PCI_HERMES
tristate Prism 2.5 PCI 802.11b adaptor support
depends on PCI  HERMES
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_APPLE_AIRPORT)   += airport.o
 obj-$(CONFIG_PLX_HERMES)   += orinoco_plx.o
 obj-$(CONFIG_PCI_HERMES)   += orinoco_pci.o
 obj-$(CONFIG_TMD_HERMES)   += orinoco_tmd.o
+obj-$(CONFIG_NORTEL_HERMES)+= orinoco_nortel.o
 
 obj-$(CONFIG_AIRO) += airo.o
 obj-$(CONFIG_AIRO_CS)  += airo_cs.o airo.o
diff --git a/drivers/net/wireless/orinoco_nortel.c 
b/drivers/net/wireless/orinoco_nortel.c
new file mode 100644
--- /dev/null
+++ b/drivers/net/wireless/orinoco_nortel.c
@@ -0,0 +1,324 @@
+/* orinoco_nortel.c
+ * 
+ * Driver for Prism II devices which would usually be driven by orinoco_cs,
+ * but are connected to the PCI bus by a Nortel PCI-PCMCIA-Adapter. 
+ *
+ * Copyright (C) 2002 Tobias Hoffmann
+ *   (C) 2003 Christoph Jungegger [EMAIL PROTECTED]
+ *
+ * Some of this code is borrowed from orinoco_plx.c
+ * Copyright (C) 2001 Daniel Barlow
+ * Some of this code is borrowed from orinoco_pci.c 
+ *  Copyright (C) 2001 Jean Tourrilhes
+ * Some of this code is inspired by linux-wlan-ng-0.1.10, but nothing
+ * has been copied from it. linux-wlan-ng-0.1.10 is originally :
+ * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
+ * 
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the License); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License
+ * at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License version 2 (the GPL), in
+ * which case the provisions of the GPL are applicable instead of the
+ * above.  If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use your
+ * version of this file under the MPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL.  If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the MPL or the GPL.
+ */
+
+#define DRIVER_NAME orinoco_nortel
+#define PFX DRIVER_NAME : 
+
+#include linux/config.h
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/sched.h
+#include linux/ptrace.h
+#include linux/slab.h
+#include linux/string.h
+#include linux/timer.h
+#include linux/ioport.h
+#include asm/uaccess.h
+#include asm/io.h
+#include asm/system.h
+#include linux/netdevice.h
+#include linux/if_arp.h
+#include linux/etherdevice.h
+#include linux/list.h
+#include linux/pci.h
+#include linux/fcntl.h
+
+#include pcmcia/cisreg.h
+
+#include hermes.h
+#include orinoco.h
+

[PATCH] orinoco: Optimize orinoco_join_ap()

2005-09-06 Thread Linux Kernel Mailing List
tree 08d8d46b486a3517f94e1c3d9077dbb156dcbd73
parent 708218b064e3ad3d55ac0f9d19b3c8c0fb7af3a4
author Pavel Roskin [EMAIL PROTECTED] Fri, 02 Sep 2005 04:06:06 -0400
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:14:07 -0400

[PATCH] orinoco: Optimize orinoco_join_ap()

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]

diff-tree cb289b9f9b2a0f3ae7070a008f22e383b37526ee (from 
56bfcdb38b3d04c1f8c1fd705e411f4be53b663c)
Author: Pavel Roskin [EMAIL PROTECTED]
Date:   Thu Sep 1 19:05:16 2005 -0400

Optimize orinoco_join_ap() - break from loop once the requested
BSSID
is found.
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/orinoco.c |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1053,8 +1053,9 @@ static void orinoco_join_ap(struct net_d
u16 channel;
} __attribute__ ((packed)) req;
const int atom_len = offsetof(struct prism2_scan_apinfo, atim);
-   struct prism2_scan_apinfo *atom;
+   struct prism2_scan_apinfo *atom = NULL;
int offset = 4;
+   int found = 0;
u8 *buf;
u16 len;
 
@@ -1089,15 +1090,18 @@ static void orinoco_join_ap(struct net_d
 * we were requested to join */
for (; offset + atom_len = len; offset += atom_len) {
atom = (struct prism2_scan_apinfo *) (buf + offset);
-   if (memcmp(atom-bssid, priv-desired_bssid, ETH_ALEN) == 0)
-   goto found;
+   if (memcmp(atom-bssid, priv-desired_bssid, ETH_ALEN) == 0) {
+   found = 1;
+   break;
+   }
}
 
-   DEBUG(1, %s: Requested AP not found in scan results\n,
- dev-name);
-   goto out;
+   if (! found) {
+   DEBUG(1, %s: Requested AP not found in scan results\n,
+ dev-name);
+   goto out;
+   }
 
- found:
memcpy(req.bssid, priv-desired_bssid, ETH_ALEN);
req.channel = atom-channel;/* both are little-endian */
err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] (3/7) iomem annotations (s2io)

2005-09-06 Thread Linux Kernel Mailing List
tree 61c6fd0a9cdf89480c88c1ecd1bcdab7c3e319d4
parent 1bea9add7391be9d83886530a610fd0694f93130
author [EMAIL PROTECTED] [EMAIL PROTECTED] Mon, 05 Sep 2005 03:25:58 +0100
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 01:57:23 -0400

[PATCH] (3/7) iomem annotations (s2io)

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/s2io.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -686,7 +686,7 @@ static void free_shared_mem(struct s2io_
 
 static int s2io_verify_pci_mode(nic_t *nic)
 {
-   XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic-bar0;
+   XENA_dev_config_t __iomem *bar0 = nic-bar0;
register u64 val64 = 0;
int mode;
 
@@ -704,7 +704,7 @@ static int s2io_verify_pci_mode(nic_t *n
  */
 static int s2io_print_pci_mode(nic_t *nic)
 {
-   XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic-bar0;
+   XENA_dev_config_t __iomem *bar0 = nic-bar0;
register u64 val64 = 0;
int mode;
struct config_param *config = nic-config;
@@ -1403,7 +1403,7 @@ static int init_nic(struct s2io_nic *nic
writeq(0xffbbffbbffbbffbbULL, bar0-mc_pause_thresh_q4q7);
 
/* Disable RMAC PAD STRIPPING */
-   add = (void *) bar0-mac_cfg;
+   add = bar0-mac_cfg;
val64 = readq(bar0-mac_cfg);
val64 = ~(MAC_CFG_RMAC_STRIP_PAD);
writeq(RMAC_CFG_KEY(0x4C0D), bar0-rmac_cfg_key);
@@ -1934,7 +1934,7 @@ static int start_nic(struct s2io_nic *ni
val64 |= 0x8000ULL;
writeq(val64, bar0-gpio_control);
val64 = 0x04110404ULL;
-   writeq(val64, (void __iomem *) ((u8 *) bar0 + 0x2700));
+   writeq(val64, (void __iomem *)bar0 + 0x2700);
}
 
/*
@@ -2395,7 +2395,7 @@ static int s2io_poll(struct net_device *
int pkt_cnt = 0, org_pkts_to_process;
mac_info_t *mac_control;
struct config_param *config;
-   XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic-bar0;
+   XENA_dev_config_t __iomem *bar0 = nic-bar0;
u64 val64;
int i;
 
@@ -2831,7 +2831,7 @@ void s2io_reset(nic_t * sp)
val64 |= 0x8000ULL;
writeq(val64, bar0-gpio_control);
val64 = 0x04110404ULL;
-   writeq(val64, (void __iomem *) ((u8 *) bar0 + 0x2700));
+   writeq(val64, (void __iomem *)bar0 + 0x2700);
}
 
/*
@@ -3234,7 +3234,7 @@ s2io_alarm_handle(unsigned long data)
 
 static void s2io_txpic_intr_handle(nic_t *sp)
 {
-   XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp-bar0;
+   XENA_dev_config_t __iomem *bar0 = sp-bar0;
u64 val64;
 
val64 = readq(bar0-pic_int_status);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] orinoco: Change orinoco_translate_scan() to return error code on error.

2005-09-06 Thread Linux Kernel Mailing List
tree 27a774e43d563b08c1929fd4417f88494e703e92
parent 7cda62455c800cf46bb86487d4f32ac6e4e8c519
author Pavel Roskin [EMAIL PROTECTED] Fri, 02 Sep 2005 04:02:50 -0400
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:13:44 -0400

[PATCH] orinoco: Change orinoco_translate_scan() to return error code on error.

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]

diff-tree 8fc038ec51acf5f777fade80c5e38112b766aeee (from 
ca955293cdfd3139e150d3b4fed3922a7eb651fb)
Author: Pavel Roskin [EMAIL PROTECTED]
Date:   Thu Sep 1 19:10:12 2005 -0400

Change orinoco_translate_scan() to return error code on error.
Adjust the caller to check for errors and clean up if needed.
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/orinoco.c |   75 -
 1 files changed, 45 insertions(+), 30 deletions(-)

diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -4021,7 +4021,8 @@ static int orinoco_ioctl_setscan(struct 
 }
 
 /* Translate scan data returned from the card to a card independant
- * format that the Wireless Tools will understand - Jean II */
+ * format that the Wireless Tools will understand - Jean II
+ * Return message length or -errno for fatal errors */
 static inline int orinoco_translate_scan(struct net_device *dev,
 char *buffer,
 char *scan,
@@ -4061,13 +4062,19 @@ static inline int orinoco_translate_scan
break;
case FIRMWARE_TYPE_INTERSIL:
offset = 4;
-   if (priv-has_hostscan)
-   atom_len = scan[0] + (scan[1]  8);
-   else
+   if (priv-has_hostscan) {
+   atom_len = le16_to_cpup((u16 *)scan);
+   /* Sanity check for atom_len */
+   if (atom_len  sizeof(struct prism2_scan_apinfo)) {
+   printk(KERN_ERR %s: Invalid atom_len in scan 
data: %d\n,
+   dev-name, atom_len);
+   return -EIO;
+   }
+   } else
atom_len = offsetof(struct prism2_scan_apinfo, atim);
break;
default:
-   return 0;
+   return -EOPNOTSUPP;
}
 
/* Check that we got an whole number of atoms */
@@ -4075,7 +4082,7 @@ static inline int orinoco_translate_scan
printk(KERN_ERR %s: Unexpected scan data length %d, 
   atom_len %d, offset %d\n, dev-name, scan_len,
   atom_len, offset);
-   return 0;
+   return -EIO;
}
 
/* Read the entries one by one */
@@ -4210,33 +4217,41 @@ static int orinoco_ioctl_getscan(struct 
/* We have some results to push back to user space */
 
/* Translate to WE format */
-   srq-length = orinoco_translate_scan(dev, extra,
-priv-scan_result,
-priv-scan_len);
-
-   /* Return flags */
-   srq-flags = (__u16) priv-scan_mode;
-
-   /* Results are here, so scan no longer in progress */
-   priv-scan_inprogress = 0;
-
-   /* In any case, Scan results will be cleaned up in the
-* reset function and when exiting the driver.
-* The person triggering the scanning may never come to
-* pick the results, so we need to do it in those places.
-* Jean II */
+   int ret = orinoco_translate_scan(dev, extra,
+priv-scan_result,
+priv-scan_len);
+
+   if (ret  0) {
+   err = ret;
+   kfree(priv-scan_result);
+   priv-scan_result = NULL;
+   } else {
+   srq-length = ret;
+
+   /* Return flags */
+   srq-flags = (__u16) priv-scan_mode;
+
+   /* In any case, Scan results will be cleaned up in the
+* reset function and when exiting the driver.
+* The person triggering the scanning may never come to
+* pick the results, so we need to do it in those 
places.
+* Jean II */
 
 #ifdef SCAN_SINGLE_READ
-   /* If you enable this option, only one client (the first
-* one) will be able to read the result (and only one
-* time). If there is multiple concurent clients that
-* want to read scan results, this behavior is not
-* advisable - Jean II */
-   

[PATCH] mv643xx: add netpoll api support

2005-09-06 Thread Linux Kernel Mailing List
tree d3ec50c0949080f2dd3977654530d575403659b5
parent 7342cd810cfd73120687d5323846e5c114cb23bb
author Dale Farnsworth [EMAIL PROTECTED] Sat, 03 Sep 2005 03:49:10 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:08:30 -0400

[PATCH] mv643xx: add netpoll api support

Add support for the netpoll api for use by netconsole, kgdb, etc.

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/mv643xx_eth.c |   44 ++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -58,11 +58,10 @@
 
 #define INT_CAUSE_UNMASK_ALL   0x0007
 #define INT_CAUSE_UNMASK_ALL_EXT   0x0011
-#ifdef MV643XX_RX_QUEUE_FILL_ON_TASK
 #define INT_CAUSE_MASK_ALL 0x
+#define INT_CAUSE_MASK_ALL_EXT 0x
 #define INT_CAUSE_CHECK_BITS   INT_CAUSE_UNMASK_ALL
 #define INT_CAUSE_CHECK_BITS_EXT   INT_CAUSE_UNMASK_ALL_EXT
-#endif
 
 #ifdef MV643XX_CHECKSUM_OFFLOAD_TX
 #define MAX_DESCS_PER_SKB  (MAX_SKB_FRAGS + 1)
@@ -1338,6 +1337,43 @@ static struct net_device_stats *mv643xx_
return mp-stats;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static inline void mv643xx_enable_irq(struct mv643xx_private *mp)
+{
+   int port_num = mp-port_num;
+   unsigned long flags;
+
+   spin_lock_irqsave(mp-lock, flags);
+   mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
+   INT_CAUSE_UNMASK_ALL);
+   mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
+   INT_CAUSE_UNMASK_ALL_EXT);
+   spin_unlock_irqrestore(mp-lock, flags);
+}
+
+static inline void mv643xx_disable_irq(struct mv643xx_private *mp)
+{
+   int port_num = mp-port_num;
+   unsigned long flags;
+
+   spin_lock_irqsave(mp-lock, flags);
+   mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num),
+   INT_CAUSE_MASK_ALL);
+   mv_write(MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port_num),
+   INT_CAUSE_MASK_ALL_EXT);
+   spin_unlock_irqrestore(mp-lock, flags);
+}
+
+static void mv643xx_netpoll(struct net_device *netdev)
+{
+   struct mv643xx_private *mp = netdev_priv(netdev);
+
+   mv643xx_disable_irq(mp);
+   mv643xx_eth_int_handler(netdev-irq, netdev, NULL);
+   mv643xx_enable_irq(mp);
+}
+#endif
+
 /*/
  * mv643xx_eth_probe
  *
@@ -1388,6 +1424,10 @@ static int mv643xx_eth_probe(struct devi
dev-weight = 64;
 #endif
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   dev-poll_controller = mv643xx_netpoll;
+#endif
+
dev-watchdog_timeo = 2 * HZ;
dev-tx_queue_len = mp-tx_ring_size;
dev-base_addr = 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] sis190: recent chipsets from SiS include a RGMII

2005-09-06 Thread Linux Kernel Mailing List
tree 543e26050dda2cdffbb0c84c1aabf5e514c86849
parent 21461380d30fb52b0bbf96dbcccd0b5096a7b346
author Francois Romieu [EMAIL PROTECTED] Sat, 03 Sep 2005 00:55:27 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:06:52 -0400

[PATCH] sis190: recent chipsets from SiS include a RGMII

Extracted from SiS's GPLed driver. From the few pdf available at SiS's,
it seems that the 965 and the 966 south bridge include this interface
whereas the 965L (and anything below) does not. It is expected to be a
sis191 related feature and should not hurt the existing sis190 driver.

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/sis190.c |   49 +
 1 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -279,6 +279,11 @@ enum sis190_eeprom_address {
EEPROMMACAddr   = 0x03
 };
 
+enum sis190_feature {
+   F_HAS_RGMII = 1,
+   F_PHY_88E   = 2
+};
+
 struct sis190_private {
void __iomem *mmio_addr;
struct pci_dev *pci_dev;
@@ -300,6 +305,7 @@ struct sis190_private {
u32 msg_enable;
struct mii_if_info mii_if;
struct list_head first_phy;
+   u32 features;
 };
 
 struct sis190_phy {
@@ -321,11 +327,12 @@ static struct mii_chip_info {
 const char *name;
 u16 id[2];
 unsigned int type;
+   u32 feature;
 } mii_chip_table[] = {
-   { Broadcom PHY BCM5461, { 0x0020, 0x60c0 }, LAN },
-   { Agere PHY ET1101B,{ 0x0282, 0xf010 }, LAN },
-   { Marvell PHY 88E,  { 0x0141, 0x0cc0 }, LAN },
-   { Realtek PHY RTL8201,  { 0x, 0x8200 }, LAN },
+   { Broadcom PHY BCM5461, { 0x0020, 0x60c0 }, LAN, 0 },
+   { Agere PHY ET1101B,{ 0x0282, 0xf010 }, LAN, 0 },
+   { Marvell PHY 88E,  { 0x0141, 0x0cc0 }, LAN, F_PHY_88E },
+   { Realtek PHY RTL8201,  { 0x, 0x8200 }, LAN, 0 },
{ NULL, }
 };
 
@@ -1309,6 +1316,7 @@ static void sis190_init_phy(struct net_d
phy-type = (p-type == MIX) ?
((mii_status  (BMSR_100FULL | BMSR_100HALF)) ?
LAN : HOME) : p-type;
+   tp-features |= p-feature;
} else
phy-type = UNKNOWN;
 
@@ -1317,6 +1325,25 @@ static void sis190_init_phy(struct net_d
  (phy-type == UNKNOWN) ? Unknown PHY : p-name, phy_id);
 }
 
+static void sis190_mii_probe_88e_fixup(struct sis190_private *tp)
+{
+   if (tp-features  F_PHY_88E) {
+   void __iomem *ioaddr = tp-mmio_addr;
+   int phy_id = tp-mii_if.phy_id;
+   u16 reg[2][2] = {
+   { 0x808b, 0x0ce1 },
+   { 0x808f, 0x0c60 }
+   }, *p;
+
+   p = (tp-features  F_HAS_RGMII) ? reg[0] : reg[1];
+
+   mdio_write(ioaddr, phy_id, 0x1b, p[0]);
+   udelay(200);
+   mdio_write(ioaddr, phy_id, 0x14, p[1]);
+   udelay(200);
+   }
+}
+
 /**
  * sis190_mii_probe - Probe MII PHY for sis190
  * @dev: the net device to probe for
@@ -1367,6 +1394,8 @@ static int __devinit sis190_mii_probe(st
/* Select default PHY for mac */
sis190_default_phy(dev);
 
+   sis190_mii_probe_88e_fixup(tp);
+
mii_if-dev = dev;
mii_if-mdio_read = __mdio_read;
mii_if-mdio_write = __mdio_write;
@@ -1506,6 +1535,11 @@ static void sis190_tx_timeout(struct net
netif_wake_queue(dev);
 }
 
+static void sis190_set_rgmii(struct sis190_private *tp, u8 reg)
+{
+   tp-features |= (reg  0x80) ? F_HAS_RGMII : 0;
+}
+
 static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 struct net_device *dev)
 {
@@ -1533,6 +1567,8 @@ static int __devinit sis190_get_mac_addr
((u16 *)dev-dev_addr)[0] = le16_to_cpu(w);
}
 
+   sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo));
+
return 0;
 }
 
@@ -1578,6 +1614,8 @@ static int __devinit sis190_get_mac_addr
outb(0x12, 0x78);
reg = inb(0x79);
 
+   sis190_set_rgmii(tp, reg);
+
/* Restore the value to ISA Bridge */
pci_write_config_byte(isa_bridge, 0x48, tmp8);
pci_dev_put(isa_bridge);
@@ -1800,6 +1838,9 @@ static int __devinit sis190_init_one(str
   dev-dev_addr[2], dev-dev_addr[3],
   dev-dev_addr[4], dev-dev_addr[5]);
 
+   net_probe(tp, KERN_INFO %s: %s mode.\n, dev-name,
+ (tp-features  F_HAS_RGMII) ? RGMII : GMII);
+
netif_carrier_off(dev);
 
sis190_set_speed_auto(dev);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] orinoco: New driver - spectrum_cs.

2005-09-06 Thread Linux Kernel Mailing List
tree 035dffa590835d9a1c998b7984d958a68f08bec4
parent ec82905177a22b0fe0abaf4ecb76813d3d45d16e
author Pavel Roskin [EMAIL PROTECTED] Fri, 02 Sep 2005 04:10:06 -0400
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:14:08 -0400

[PATCH] orinoco: New driver - spectrum_cs.

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]

diff-tree dee4f325520d4ea29397dd67ca657b7235bb1790 (from 
c88faac230cc9775445e5c644991c352e35c72a1)
Author: Pavel Roskin [EMAIL PROTECTED]
Date:   Thu Sep 1 17:46:39 2005 -0400

New driver - spectrum_cs.

Driver for 802.11b cards using RAM-loadable Symbol firmware, such as
Symbol Wireless Networker LA4100, CompactFlash cards by Socket
Communications and Intel PRO/Wireless 2011B.

The driver implements Symbol firmware download.  The rest is handled
in hermes.c and orinoco.c.

Utilities for downloading the Symbol firmware are available at
http://sourceforge.net/projects/orinoco/
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/Kconfig   |   13 
 drivers/net/wireless/Makefile  |1 
 drivers/net/wireless/spectrum_cs.c | 1120 +
 3 files changed, 1134 insertions(+)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -375,6 +375,19 @@ config PCMCIA_HERMES
  configure your card and that /etc/pcmcia/wireless.opts works:
  http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html.
 
+config PCMCIA_SPECTRUM
+   tristate Symbol Spectrum24 Trilogy PCMCIA card support
+   depends on NET_RADIO  PCMCIA  HERMES
+   ---help---
+
+ This is a driver for 802.11b cards using RAM-loadable Symbol
+ firmware, such as Symbol Wireless Networker LA4100, CompactFlash
+ cards by Socket Communications and Intel PRO/Wireless 2011B.
+
+ This driver requires firmware download on startup.  Utilities
+ for downloading Symbol firmware are available at
+ http://sourceforge.net/projects/orinoco/
+
 config AIRO_CS
tristate Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards
depends on NET_RADIO  PCMCIA  (BROKEN || !M32R)
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_PLX_HERMES)  += orinoco_plx.
 obj-$(CONFIG_PCI_HERMES)   += orinoco_pci.o
 obj-$(CONFIG_TMD_HERMES)   += orinoco_tmd.o
 obj-$(CONFIG_NORTEL_HERMES)+= orinoco_nortel.o
+obj-$(CONFIG_PCMCIA_SPECTRUM)  += spectrum_cs.o
 
 obj-$(CONFIG_AIRO) += airo.o
 obj-$(CONFIG_AIRO_CS)  += airo_cs.o airo.o
diff --git a/drivers/net/wireless/spectrum_cs.c 
b/drivers/net/wireless/spectrum_cs.c
new file mode 100644
--- /dev/null
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -0,0 +1,1120 @@
+/*
+ * Driver for 802.11b cards using RAM-loadable Symbol firmware, such as
+ * Symbol Wireless Networker LA4100, CompactFlash cards by Socket
+ * Communications and Intel PRO/Wireless 2011B.
+ *
+ * The driver implements Symbol firmware download.  The rest is handled
+ * in hermes.c and orinoco.c.
+ *
+ * Utilities for downloading the Symbol firmware are available at
+ * http://sourceforge.net/projects/orinoco/
+ *
+ * Copyright (C) 2002-2005 Pavel Roskin [EMAIL PROTECTED]
+ * Portions based on orinoco_cs.c:
+ * Copyright (C) David Gibson, Linuxcare Australia
+ * Portions based on Spectrum24tDnld.c from original spectrum24 driver:
+ * Copyright (C) Symbol Technologies.
+ *
+ * See copyright notice in file orinoco.c.
+ */
+
+#define DRIVER_NAME spectrum_cs
+#define PFX DRIVER_NAME : 
+
+#include linux/config.h
+#ifdef  __IN_PCMCIA_PACKAGE__
+#include pcmcia/k_compat.h
+#endif /* __IN_PCMCIA_PACKAGE__ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/sched.h
+#include linux/ptrace.h
+#include linux/slab.h
+#include linux/string.h
+#include linux/ioport.h
+#include linux/netdevice.h
+#include linux/if_arp.h
+#include linux/etherdevice.h
+#include linux/wireless.h
+
+#include pcmcia/cs_types.h
+#include pcmcia/cs.h
+#include pcmcia/cistpl.h
+#include pcmcia/cisreg.h
+#include pcmcia/ds.h
+
+#include asm/uaccess.h
+#include asm/io.h
+#include asm/system.h
+
+#include orinoco.h
+
+/*
+ * If SPECTRUM_FW_INCLUDED is defined, the firmware is hardcoded into
+ * the driver.  Use get_symbol_fw script to generate spectrum_fw.h and
+ * copy it to the same directory as spectrum_cs.c.
+ *
+ * If SPECTRUM_FW_INCLUDED is not defined, the firmware is loaded at the
+ * runtime using hotplug.  Use the same get_symbol_fw script to generate
+ * files symbol_sp24t_prim_fw symbol_sp24t_sec_fw, copy them to the
+ * hotplug firmware directory (typically /usr/lib/hotplug/firmware) and
+ * make sure that you have hotplug installed and enabled in the kernel.
+ */
+/* #define SPECTRUM_FW_INCLUDED 1 */
+
+#ifdef SPECTRUM_FW_INCLUDED

[PATCH] mv643xx: fix skb memory leak

2005-09-06 Thread Linux Kernel Mailing List
tree b6903b12d4124a6fa835cab4b35db1eb99a6d1aa
parent e797637f4c1cbcecb2d8f5cfa05b161da1f0b802
author Dale Farnsworth [EMAIL PROTECTED] Thu, 01 Sep 2005 23:59:23 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:08:30 -0400

[PATCH] mv643xx: fix skb memory leak

This patch fixes an skb memory leak under heavy receive load
(whenever the more packets have been received than the NAPI budget
allows to be processed).

Signed-off-by: Dale Farnsworth [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/mv643xx_eth.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -412,15 +412,13 @@ static int mv643xx_eth_receive_queue(str
struct pkt_info pkt_info;
 
 #ifdef MV643XX_NAPI
-   while (eth_port_receive(mp, pkt_info) == ETH_OK  budget  0) {
+   while (budget--  0  eth_port_receive(mp, pkt_info) == ETH_OK) {
 #else
while (eth_port_receive(mp, pkt_info) == ETH_OK) {
 #endif
mp-rx_ring_skbs--;
received_packets++;
-#ifdef MV643XX_NAPI
-   budget--;
-#endif
+
/* Update statistics. Note byte count includes 4 byte CRC count 
*/
stats-rx_packets++;
stats-rx_bytes += pkt_info.byte_cnt;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] 'mdio_bus_exit' in discarded section .text.exit

2005-09-06 Thread Linux Kernel Mailing List
tree 33d78bd454e1c6d7d459f009ca9c6ff0ce345536
parent 9d8cc1b6c3cba2be61c0884e3a04dd6baea70654
author Peter Chubb [EMAIL PROTECTED] Sun, 04 Sep 2005 04:05:06 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 02:04:19 -0400

[PATCH] 'mdio_bus_exit' in discarded section .text.exit

When building with  CONFIG_PHYLIB=y on Itanium, I see:
 `mdio_bus_exit' referenced in section `.init.text' of
drivers/built-in.o: defined in discarded section `.exit.text' of
drivers/built-in.o

I believe that mdio_bus_exit should not be declared __exit, because it is
referencesd from __init sections in, say, phy_init().

Signed-off-by: Peter Chubb [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/phy/mdio_bus.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -170,7 +170,7 @@ int __init mdio_bus_init(void)
return bus_register(mdio_bus_type);
 }
 
-void __exit mdio_bus_exit(void)
+void mdio_bus_exit(void)
 {
bus_unregister(mdio_bus_type);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] (6/7) missing include (ipw2200)

2005-09-06 Thread Linux Kernel Mailing List
tree 4181cb682b768f7f73bfc7df1975349736296319
parent 2be041a79bbdbb3c830f4cc3bc3387ba6fff7566
author [EMAIL PROTECTED] [EMAIL PROTECTED] Mon, 05 Sep 2005 03:26:13 +0100
committer Jeff Garzik [EMAIL PROTECTED] Tue, 06 Sep 2005 01:57:23 -0400

[PATCH] (6/7) missing include (ipw2200)

added missing include of dma-mapping.h

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/ipw2200.h |1 +
 1 files changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -42,6 +42,7 @@
 #include linux/etherdevice.h
 #include linux/delay.h
 #include linux/random.h
+#include linux/dma-mapping.h
 
 #include linux/firmware.h
 #include linux/wireless.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: create tarballs

2005-09-06 Thread Linux Kernel Mailing List
tree 137bc3a30d14ec9777d2a6d311652582ecdadad0
parent 7ac3db59fd4410405ce55e2a25c397aec440d8da
author Jan-Benedict Glaw [EMAIL PROTECTED] Tue, 24 May 2005 11:27:37 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Tue, 12 Jul 2005 22:40:17 +

[PATCH] kbuild: create tarballs

It adds tarball packaging, which I prefer for distribution.
Also one of the two blanks after @echo is removed. One seems to be enough :)

Signed-off-by: Jan-Benedict Glaw [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/package/Makefile |   19 ++--
 scripts/package/buildtar |  111 +++
 2 files changed, 127 insertions(+), 3 deletions(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -80,10 +80,23 @@ deb-pkg:
 clean-dirs += $(objtree)/debian/
 
 
+# tarball targets
+# ---
+.PHONY: tar%pkg
+tar%pkg:
+   $(MAKE)
+   $(CONFIG_SHELL) $(srctree)/scripts/package/buildtar $@
+
+clean-dirs += $(objtree)/tar-install/
+
+
 # Help text displayed when executing 'make help'
 # ---
 help:
-   @echo  '  rpm-pkg - Build the kernel as an RPM package'
-   @echo  '  binrpm-pkg  - Build an rpm package containing the 
compiled kernel  modules'
-   @echo  '  deb-pkg - Build the kernel as an deb package'
+   @echo '  rpm-pkg - Build the kernel as an RPM package'
+   @echo '  binrpm-pkg  - Build an rpm package containing the compiled 
kernel  modules'
+   @echo '  deb-pkg - Build the kernel as an deb package'
+   @echo '  tar-pkg - Build the kernel as an uncompressed tarball'
+   @echo '  targz-pkg   - Build the kernel as a gzip compressed 
tarball'
+   @echo '  tarbz2-pkg  - Build the kernel as a bzip2 compressed 
tarball'
 
diff --git a/scripts/package/buildtar b/scripts/package/buildtar
new file mode 100644
--- /dev/null
+++ b/scripts/package/buildtar
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+#
+# buildtar 0.0.3
+#
+# (C) 2004-2005 by Jan-Benedict Glaw [EMAIL PROTECTED]
+#
+# This script is used to compile a tarball from the currently
+# prepared kernel. Based upon the builddeb script from
+# Wichert Akkerman [EMAIL PROTECTED].
+#
+
+set -e
+
+#
+# Some variables and settings used throughout the script
+#
+version=${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${EXTRAVERSION}${EXTRANAME}
+tmpdir=${objtree}/tar-install
+tarball=${objtree}/linux-${version}.tar
+
+
+#
+# Figure out how to compress, if requested at all
+#
+case ${1} in
+   tar-pkg)
+   compress=cat
+   file_ext=
+   ;;
+   targz-pkg)
+   compress=gzip -c9
+   file_ext=.gz
+   ;;
+   tarbz2-pkg)
+   compress=bzip2 -c9
+   file_ext=.bz2
+   ;;
+   *)
+   echo Unknown tarball target \${1}\ requested, please add it 
to ${0}. 2
+   exit 1
+   ;;
+esac
+
+
+#
+# Clean-up and re-create the temporary directory
+#
+rm -rf -- ${tmpdir}
+mkdir -p -- ${tmpdir}/boot
+
+
+#
+# Try to install modules
+#
+if ! make INSTALL_MOD_PATH=${tmpdir} modules_install; then
+   echo  2
+   echo Ignoring error at module_install time, since that could be 2
+   echo a result of missing local modutils/module-init-tools, 2
+   echo or you just didn't compile in module support at all... 2
+   echo  2
+fi
+
+
+#
+# Install basic kernel files
+#
+cp -v -- System.map ${tmpdir}/boot/System.map-${version}
+cp -v -- .config ${tmpdir}/boot/config-${version}
+cp -v -- vmlinux ${tmpdir}/boot/vmlinux-${version}
+
+
+#
+# Install arch-specific kernel image(s)
+#
+case ${ARCH} in
+   i386)
+   [ -f arch/i386/boot/bzImage ]  cp -v -- 
arch/i386/boot/bzImage ${tmpdir}/boot/vmlinuz-${version}
+   ;;
+   alpha)
+   [ -f arch/alpha/boot/vmlinux.gz ]  cp -v -- 
arch/alpha/boot/vmlinux.gz ${tmpdir}/boot/vmlinuz-${version}
+   ;;
+   vax)
+   [ -f vmlinux.SYS ]  cp -v -- vmlinux.SYS 
${tmpdir}/boot/vmlinux-${version}.SYS
+   [ -f vmlinux.dsk ]  cp -v -- vmlinux.dsk 
${tmpdir}/boot/vmlinux-${version}.dsk
+   ;;
+   *)
+   [ -f ${KBUILD_IMAGE} ]  cp -v -- ${KBUILD_IMAGE} 
${tmpdir}/boot/vmlinux-kbuild-${version}
+   echo  2
+   echo '** ** **  WARNING  ** ** **' 2
+   echo  2
+   echo Your architecture did not define any 
architecture-dependant files 2
+   echo to be placed into the tarball. Please add those to ${0} 
... 2
+   echo  2
+   sleep 5
+   ;;
+esac
+
+
+#
+# Create the tarball
+#
+(
+   cd ${tmpdir}
+   tar cf - . | ${compress}  ${tarball}${file_ext}
+)
+
+echo Tarball 

[PATCH] kbuild: modpost needs to cope with new glibc elf header on sparc

2005-09-06 Thread Linux Kernel Mailing List
tree 480fc54b0cbbe95ba34b87ae9bf1801d85a5164c
parent 6d983feab80948cdd0e3920c40d453a6436eeb23
author Fabio Massimo Di Nitto [EMAIL PROTECTED] Wed, 13 Jul 2005 08:25:49 
+0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 13 Jul 2005 17:05:32 +

[PATCH] kbuild: modpost needs to cope with new glibc elf header on sparc

Recently a change in the glibc elf.h header has been introduced causing
modpost to spawn tons of warnings (like the one below) building the kernel
on sparc:

[SNIP]
*** Warning: current_thread_info_reg [net/sunrpc/auth_gss/auth_rpcgss.ko] 
undefined!
*** Warning:  [net/sunrpc/auth_gss/auth_rpcgss.ko] undefined!
*** Warning:  [net/sunrpc/auth_gss/auth_rpcgss.ko] undefined!
[SNIP]

Ben Collins discovered that the STT_REGISTERED definition in glibc did change
and that this change needs to be propagated to modpost.

glibc change:
-#define STT_REGISTER   13  /* Global register reserved to app. */
+#define STT_SPARC_REGISTER 13  /* Global register reserved to app. */

I did and tested this simple patch to maintain compatibility with newer (= 
2.3.4)
and older (= 2.3.2) glibc.

Signed-off-by: Fabio M. Di Nitto [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/mod/modpost.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -359,11 +359,16 @@ handle_modversions(struct module *mod, s
/* ignore __this_module, it will be resolved shortly */
if (strcmp(symname, MODULE_SYMBOL_PREFIX __this_module) == 0)
break;
-#ifdef STT_REGISTER
+/* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */
+#if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER)
+/* add compatibility with older glibc */
+#ifndef STT_SPARC_REGISTER
+#define STT_SPARC_REGISTER STT_REGISTER
+#endif
if (info-hdr-e_machine == EM_SPARC ||
info-hdr-e_machine == EM_SPARCV9) {
/* Ignore register directives. */
-   if (ELF_ST_TYPE(sym-st_info) == STT_REGISTER)
+   if (ELF_ST_TYPE(sym-st_info) == STT_SPARC_REGISTER)
break;
}
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: make 'cscope -q' play well with cscope.el

2005-09-06 Thread Linux Kernel Mailing List
tree 793c0d842fc8bafb180c298042e3227e30375ccd
parent d2cb1a95c5fa4d1691c90a4f530955b4ea3cfa24
author Karl Hegbloom [EMAIL PROTECTED] Sun, 19 Jun 2005 14:50:47 -0700
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 13 Jul 2005 21:45:57 +

[PATCH] kbuild: make 'cscope -q' play well with cscope.el

I tried the Linux Makefile 'make cscope' target, and found that the
generated database is not compatible with 'cscope.el' under XEmacs.
The thing is that 'cscope.el' does not allow setting the command line
options to the 'cscope' commands it runs, and it errors with a message
about the options not matching the ones used to generate the index.

It turns out the cscope designers already thought of this.  The
options can be written into the cscope.files.  The included patch
moves the -q and -k options from the 'cmd_cscope' to the
'cmd_cscope-file', echoing them into the top of the files listing.

Now the index is generated with the -q option, and when 'cscope.el'
performs it's search, it uses that argument as well.  Lookups are fast
and everyone is happy.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1177,10 +1177,10 @@ define all-sources
 endef
 
 quiet_cmd_cscope-file = FILELST cscope.files
-  cmd_cscope-file = $(all-sources)  cscope.files
+  cmd_cscope-file = (echo \-k; echo \-q; $(all-sources))  cscope.files
 
 quiet_cmd_cscope = MAKEcscope.out
-  cmd_cscope = cscope -k -b -q
+  cmd_cscope = cscope -b
 
 cscope: FORCE
$(call cmd,cscope-file)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: allow cscope to index multiple architectures

2005-09-06 Thread Linux Kernel Mailing List
tree 749a25f86a745f2f8e94cdee2b8e1c4d1b0db28f
parent acbef459a663a8349ceb46b5a11ede50fa7909c7
author Ian Campbell [EMAIL PROTECTED] Thu, 23 Jun 2005 11:25:54 +0100
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 13 Jul 2005 22:07:04 +

[PATCH] kbuild: allow cscope to index multiple architectures

I have a single source tree which I cross compile for a couple of
different architectures using ARHC=foo O=blah etc.

The existing cscope target is very handy but only indexes the current
$(ARCH), which is a pain since inevitably I'm interested in the other
one at any given time ;-). This patch allows me to pass a list of
architectures for cscope to index. e.g.
make ALLSOURCE_ARCHS=i386 arm cscope

This change also works for etags etc, and I presume it is just as useful
there.

Signed-off-by: Ian Campbell [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 Makefile |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1159,19 +1159,25 @@ else
 __srctree = $(srctree)/
 endif
 
+ALLSOURCE_ARCHS := $(ARCH)
+
 define all-sources
( find $(__srctree) $(RCS_FIND_IGNORE) \
   \( -name include -o -name arch \) -prune -o \
   -name '*.[chS]' -print; \
- find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \
-  -name '*.[chS]' -print; \
+ for ARCH in $(ALLSOURCE_ARCHS) ; do \
+  find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
+   -name '*.[chS]' -print; \
+ done ; \
  find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
   -name '*.[chS]' -print; \
  find $(__srctree)include $(RCS_FIND_IGNORE) \
   \( -name config -o -name 'asm-*' \) -prune \
   -o -name '*.[chS]' -print; \
- find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
-  -name '*.[chS]' -print; \
+ for ARCH in $(ALLSOURCE_ARCHS) ; do \
+  find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \
+   -name '*.[chS]' -print; \
+ done ; \
  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
   -name '*.[chS]' -print )
 endef
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: obey HOSTLOADLIBES_programname for single-file compilation

2005-09-06 Thread Linux Kernel Mailing List
tree e8c94d9e722e1387ea5c01c3833046870f8141cf
parent a0674e88d9c150e016a69e78e735f48772314c53
author Matthias Urlichs [EMAIL PROTECTED] Fri, 18 Feb 2005 10:23:41 +0100
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 13 Jul 2005 22:11:14 +

[PATCH] kbuild: obey HOSTLOADLIBES_programname for single-file compilation

Single-file HOSTCC calls added the libraries from $(HOSTLOADLIBES),
but not from $(HOSTLOADLIBES_programname). Multi-file HOSTCC calls do
both.

This patch fixes that inconsistency.

Signed-Off-By: Matthias Urlichs [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/Makefile.host |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.host b/scripts/Makefile.host
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -98,7 +98,8 @@ hostcxx_flags  = -Wp,-MD,$(depfile) $(__
 # Create executable from a single .c file
 # host-csingle - Executable
 quiet_cmd_host-csingle = HOSTCC  $@
-  cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $
+  cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $ \
+   $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
 $(host-csingle): %: %.c FORCE
$(call if_changed_dep,host-csingle)
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scripts/kernel-doc: don't use uninitialized SRCTREE

2005-09-06 Thread Linux Kernel Mailing List
tree 7edbe30174376b214e8583b3a0b24cb1c26f625c
parent 66da665ca36b07728acf35881f918a89a2c9fbb2
author Randy Dunlap [EMAIL PROTECTED] Fri, 08 Jul 2005 05:39:26 -0700
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 13 Jul 2005 23:18:36 +

[PATCH] scripts/kernel-doc: don't use uninitialized SRCTREE

Current kernel-doc (perl) script generates this warning:
Use of uninitialized value in concatenation (.) or string at scripts/kernel-doc 
line 1668.

So explicitly check for SRCTREE in the ENV before using it,
and then if it is set, append a '/' to the end of it, otherwise
the SRCTREE + filename can (will) be missing the intermediate '/'.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/kernel-doc |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1665,11 +1665,17 @@ sub xml_escape($) {
 }
 
 sub process_file($) {
-my ($file) = $ENV{'SRCTREE'[EMAIL PROTECTED];
+my $file;
 my $identifier;
 my $func;
 my $initial_section_counter = $section_counter;
 
+if (defined($ENV{'SRCTREE'})) {
+   $file = $ENV{'SRCTREE'} . / . @_;
+}
+else {
+   $file = @_;
+}
 if (defined($source_map{$file})) {
$file = $source_map{$file};
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: make help binrpm-pkg fix

2005-09-06 Thread Linux Kernel Mailing List
tree 83e4cdb30891f3af2dbbb8336aec37ca03786ab3
parent 3c521e06fad4b4b7fe4811fb8363d12cf49f40a2
author Coywolf Qi Hunt [EMAIL PROTECTED] Tue, 19 Jul 2005 19:42:54 -0500
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 21 Jul 2005 21:45:47 +

[PATCH] kbuild: make help binrpm-pkg fix

This fixes kbuild make help binrpm-pkg missing `''.

Signed-off-by: Coywolf Qi Hunt [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/package/Makefile |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -94,7 +94,7 @@ clean-dirs += $(objtree)/tar-install/
 # ---
 help:
@echo '  rpm-pkg - Build the kernel as an RPM package'
-   @echo '  binrpm-pkg  - Build an rpm package containing the compiled 
kernel
+   @echo '  binrpm-pkg  - Build an rpm package containing the compiled 
kernel'
@echo 'and modules'
@echo '  deb-pkg - Build the kernel as an deb package'
@echo '  tar-pkg - Build the kernel as an uncompressed tarball'
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: fix building external modules

2005-09-06 Thread Linux Kernel Mailing List
tree 346bee7ee9cc5929c897825c9a86cb303f945745
parent 72ba47c1b293ae78f7d798b458bb9d3db65c7551
author Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 22:11:01 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 22:11:01 +0200

kbuild: fix building external modules

kbuild failed to locate Makefile for external modules.
This brought to my attention how the variables for directories
have different values in different usage scenarios.

Different kbuild usage scenarios:
make   - plain make in same directory where kernel source lives
make O=- kbuild is told to store output files in another directory
make M=- building an external module
make O= M= - building an external module with kernel output seperate from src

Value assigned to the different variables:

   |$(src)  |$(obj) |$(srctree)|$(objtree)
make   |reldir to k src |as src |abs path to k src |abs path to k src
make O=|reldir to k src |as src |abs path to k src |abs path to output dir
make M=|abs path to src |as src |abs path to k src |abs path to k src
make O= M= |abs path to src |as src |abs path to k src |abs path to k output

path to kbuild file:

make   | $(srctree)/$(src), $(src)
make O=| $(srctree)/$(src)
make M=| $(src)
make O= M= | $(src)

From the table above it can be seen that the only good way to find the
home directory of the kbuild file is to locate the one of the two variants
that is an absolute path. If $(src) is an absolute path (starts with /)
then use it, otherwise prefix $(src) with $(srctree).

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/Makefile.build |4 ++--
 scripts/Makefile.clean |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -11,8 +11,8 @@ __build:
 -include .config
 
 # The filename Kbuild has precedence over Makefile
-include $(if $(wildcard $(srctree)/$(src)/Kbuild), \
-$(srctree)/$(src)/Kbuild, $(srctree)/$(src)/Makefile)
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, 
$(kbuild-dir)/Makefile)
 
 include scripts/Kbuild.include
 include scripts/Makefile.lib
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -13,8 +13,8 @@ __clean:
 clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
 
 # The filename Kbuild has precedence over Makefile
-include $(if $(wildcard $(srctree)/$(src)/Kbuild), \
-$(srctree)/$(src)/Kbuild, $(srctree)/$(src)/Makefile)
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, 
$(kbuild-dir)/Makefile)
 
 # Figure out what we need to build from the various variables
 # ==
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: fix buildcheck

2005-09-06 Thread Linux Kernel Mailing List
tree c68fa3752d3868388623ae017c68a9cf39d19551
parent 33bc25eae40c100238a5abe8472cef0cd40226f1
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:20:13 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:20:13 +

kbuild: fix buildcheck

From: Randy Dunlap [EMAIL PROTECTED]

I should not have added init.text test here;
it's more than useless, it actually degrades the output.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/reference_discarded.pl |2 --
 1 files changed, 2 deletions(-)

diff --git a/scripts/reference_discarded.pl b/scripts/reference_discarded.pl
--- a/scripts/reference_discarded.pl
+++ b/scripts/reference_discarded.pl
@@ -82,8 +82,6 @@ foreach $object (keys(%object)) {
}
if (($line =~ /\.text\.exit$/ ||
 $line =~ /\.exit\.text$/ ||
-$line =~ /\.text\.init$/ ||
-$line =~ /\.init\.text$/ ||
 $line =~ /\.data\.exit$/ ||
 $line =~ /\.exit\.data$/ ||
 $line =~ /\.exitcall\.exit$/) 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: Avoid inconsistent kallsyms data

2005-09-06 Thread Linux Kernel Mailing List
tree c93562d7c66856108e7dfe43e1e85304cebb5d91
parent 53e88e03e63621a15ec7fbccaaaca1a0f1616ed4
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:15:44 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:15:44 +

kbuild: Avoid inconsistent kallsyms data

Several reports on inconsistent kallsyms data has been caused by the aliased 
symbols
__sched_text_start and __down to shift places in the output of nm.
The root cause was that on second pass ld aligned __sched_text_start to a 4 
byte boundary
which is the function alignment on i386.
sched.text and spinlock.text is now aligned to an 8 byte boundary to make sure 
they
are aligned to a function alignemnt on most (all?) archs.

Tested by: Paulo Marques [EMAIL PROTECTED]
Tested by: Alexander Stohr [EMAIL PROTECTED]

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 include/asm-generic/vmlinux.lds.h |9 +
 1 files changed, 9 insertions(+)

diff --git a/include/asm-generic/vmlinux.lds.h 
b/include/asm-generic/vmlinux.lds.h
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -6,6 +6,9 @@
 #define VMLINUX_SYMBOL(_sym_) _sym_
 #endif
 
+/* Align . to a 8 byte boundary equals to maximum function alignment. */
+#define ALIGN_FUNCTION()  . = ALIGN(8)
+
 #define RODATA \
.rodata   : AT(ADDR(.rodata) - LOAD_OFFSET) {   \
*(.rodata) *(.rodata.*) \
@@ -79,12 +82,18 @@
VMLINUX_SYMBOL(__security_initcall_end) = .;\
}
 
+/* sched.text is aling to function alignment to secure we have same
+ * address even at second ld pass when generating System.map */
 #define SCHED_TEXT \
+   ALIGN_FUNCTION();   \
VMLINUX_SYMBOL(__sched_text_start) = .; \
*(.sched.text)  \
VMLINUX_SYMBOL(__sched_text_end) = .;
 
+/* spinlock.text is aling to function alignment to secure we have same
+ * address even at second ld pass when generating System.map */
 #define LOCK_TEXT  \
+   ALIGN_FUNCTION();   \
VMLINUX_SYMBOL(__lock_text_start) = .;  \
*(.spinlock.text)   \
VMLINUX_SYMBOL(__lock_text_end) = .;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


buildcheck: reduce DEBUG_INFO noise from reference* scripts

2005-09-06 Thread Linux Kernel Mailing List
tree 011c20fd2e8c9e78539911f310f7d64b28a61e21
parent cfca82f2179dd1aee84a5bf3b14710e4d7487aed
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:14:42 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:14:42 +

buildcheck: reduce DEBUG_INFO noise from reference* scripts

From: Randy Dunlap [EMAIL PROTECTED]

Reduce noise in 'make buildcheck' that is caused by CONFIG_DEBUG_INFO=y.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/reference_discarded.pl |3 +++
 scripts/reference_init.pl  |1 +
 2 files changed, 4 insertions(+)

diff --git a/scripts/reference_discarded.pl b/scripts/reference_discarded.pl
--- a/scripts/reference_discarded.pl
+++ b/scripts/reference_discarded.pl
@@ -82,6 +82,8 @@ foreach $object (keys(%object)) {
}
if (($line =~ /\.text\.exit$/ ||
 $line =~ /\.exit\.text$/ ||
+$line =~ /\.text\.init$/ ||
+$line =~ /\.init\.text$/ ||
 $line =~ /\.data\.exit$/ ||
 $line =~ /\.exit\.data$/ ||
 $line =~ /\.exitcall\.exit$/) 
@@ -96,6 +98,7 @@ foreach $object (keys(%object)) {
 $from !~ /\.debug_ranges$/ 
 $from !~ /\.debug_line$/ 
 $from !~ /\.debug_frame$/ 
+$from !~ /\.debug_loc$/ 
 $from !~ /\.exitcall\.exit$/ 
 $from !~ /\.eh_frame$/ 
 $from !~ /\.stab$/)) {
diff --git a/scripts/reference_init.pl b/scripts/reference_init.pl
--- a/scripts/reference_init.pl
+++ b/scripts/reference_init.pl
@@ -98,6 +98,7 @@ foreach $object (sort(keys(%object))) {
 $from !~ /\.pdr$/ 
 $from !~ /\__param$/ 
 $from !~ /\.altinstructions/ 
+$from !~ /\.eh_frame/ 
 $from !~ /\.debug_/)) {
printf(Error: %s %s refers to %s\n, $object, $from, 
$line);
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: signed char fixes for scripts

2005-09-06 Thread Linux Kernel Mailing List
tree b401885e7bb2583f55c9e465e7d91e73398ef7e5
parent 84c2a2eb348f3bd85ec8eb3bb95ba04f65f4e217
author J.A. Magallon [EMAIL PROTECTED] Fri, 15 Jul 2005 22:14:43 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 22:27:08 +0200

[PATCH] kbuild: signed char fixes for scripts

This time I did not break anything... and they shut up gcc4 ;)

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/conmakehash.c|2 +-
 scripts/kallsyms.c   |6 +++---
 scripts/mod/sumversion.c |8 
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c
--- a/scripts/conmakehash.c
+++ b/scripts/conmakehash.c
@@ -33,7 +33,7 @@ void usage(char *argv0)
 
 int getunicode(char **p0)
 {
-  unsigned char *p = *p0;
+  char *p = *p0;
 
   while (*p == ' ' || *p == '\t')
 p++;
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -207,9 +207,9 @@ symbol_valid(struct sym_entry *s)
 * move then they may get dropped in pass 2, which breaks the
 * kallsyms rules.
 */
-   if ((s-addr == _etext  strcmp(s-sym + offset, _etext)) ||
-   (s-addr == _einittext  strcmp(s-sym + offset, 
_einittext)) ||
-   (s-addr == _eextratext  strcmp(s-sym + offset, 
_eextratext)))
+   if ((s-addr == _etext  strcmp((char*)s-sym + offset, 
_etext)) ||
+   (s-addr == _einittext  strcmp((char*)s-sym + offset, 
_einittext)) ||
+   (s-addr == _eextratext  strcmp((char*)s-sym + offset, 
_eextratext)))
return 0;
}
 
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -252,9 +252,9 @@ static int parse_comment(const char *fil
 }
 
 /* FIXME: Handle .s files differently (eg. # starts comments) --RR */
-static int parse_file(const signed char *fname, struct md4_ctx *md)
+static int parse_file(const char *fname, struct md4_ctx *md)
 {
-   signed char *file;
+   char *file;
unsigned long i, len;
 
file = grab_file(fname, len);
@@ -332,7 +332,7 @@ static int parse_source_files(const char
   Sum all files in the same dir or subdirs.
*/
while ((line = get_next_line(pos, file, flen)) != NULL) {
-   signed char* p = line;
+   char* p = line;
if (strncmp(line, deps_, sizeof(deps_)-1) == 0) {
check_files = 1;
continue;
@@ -458,7 +458,7 @@ out:
close(fd);
 }
 
-static int strip_rcs_crap(signed char *version)
+static int strip_rcs_crap(char *version)
 {
unsigned int len, full_len;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: pass less variables to second make invocation when using make O=...

2005-09-06 Thread Linux Kernel Mailing List
tree e9e4ed73d3ae15994916137b6e6d6b15158f1a58
parent e579d351b4bcea0038f5df08fff7160352b2c365
author Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 09:12:07 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 09:12:07 +0200

kbuild: pass less variables to second make invocation when using make O=...

make exports all variables assigned on the command-line, so no need to pass
them explicit.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=4725

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

 Makefile |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -109,10 +109,9 @@ $(if $(KBUILD_OUTPUT),, \
 .PHONY: $(MAKECMDGOALS)
 
 $(filter-out _all,$(MAKECMDGOALS)) _all:
-   $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
-   KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE)   \
-   KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD=$(KBUILD_EXTMOD)   \
--f $(CURDIR)/Makefile $@
+   $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
+   KBUILD_SRC=$(CURDIR) \
+   KBUILD_EXTMOD=$(KBUILD_EXTMOD) -f $(CURDIR)/Makefile $@
 
 # Leave processing to above invocation of make
 skip-makefile := 1
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: fix make TAGS (for emacs use)

2005-09-06 Thread Linux Kernel Mailing List
tree 5e888e7ffbd70a82c9345ea51d83cb163db27d5d
parent 49490571bcfe24d279a66ba24198e8ba299fe58f
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 28 Jul 2005 23:11:34 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 28 Jul 2005 23:11:34 +0200

kbuild: fix make TAGS (for emacs use)

From: [EMAIL PROTECTED] Jeremy Bongio
make TAGS does not make source code tags for emacs. It instead
returns an error than etags - isn't valid. The problem is
easily remedied.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 Makefile |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1203,9 +1203,15 @@ cscope: FORCE
$(call cmd,cscope)
 
 quiet_cmd_TAGS = MAKE   $@
-cmd_TAGS = $(all-sources) | etags -
+define cmd_TAGS
+   rm -f $@; \
+   ETAGSF=`etags --version | grep -i exuberant /dev/null  echo -I 
__initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f`; \
+   $(all-sources) | xargs etags $$ETAGSF -a
+endef
+
+TAGS: FORCE
+   $(call cmd,TAGS)
 
-#  Exuberant ctags works better with -I
 
 quiet_cmd_tags = MAKE   $@
 define cmd_tags
@@ -1214,9 +1220,6 @@ define cmd_tags
$(all-sources) | xargs ctags $$CTAGSF -a
 endef
 
-TAGS: FORCE
-   $(call cmd,TAGS)
-
 tags: FORCE
$(call cmd,tags)
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: KBUILD_VERBOSE was exported twice

2005-09-06 Thread Linux Kernel Mailing List
tree 619884215ec5f0d0585f2b7b4f8aca56c8dc2891
parent f9f97bc014d7402cd2d135e20bcd25dfec93257b
author Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 08:10:10 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 08:10:10 +0200

kbuild: KBUILD_VERBOSE was exported twice

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=4727

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

 Makefile |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -233,7 +233,7 @@ ifeq ($(MAKECMDGOALS),)
   KBUILD_MODULES := 1
 endif
 
-export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE
+export KBUILD_MODULES KBUILD_BUILTIN
 export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD
 
 # Beautify output
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kallsyms: clarify KALLSYMS_ALL help text

2005-09-06 Thread Linux Kernel Mailing List
tree f78726abcf94875f498593ef1e4cab76d5b6b32b
parent 2315c6e42278152360470124ce903ecb8c97270a
author Jesper Juhl [EMAIL PROTECTED] Wed, 20 Jul 2005 05:43:05 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Tue, 26 Jul 2005 10:16:12 +

[PATCH] kallsyms: clarify KALLSYMS_ALL help text

Clarify the KALLSYMS_ALL help text slightly.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]

 init/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -260,8 +260,8 @@ config KALLSYMS_ALL
help
   Normally kallsyms only contains the symbols of functions, for nicer
   OOPS messages.  Some debuggers can use kallsyms for other
-  symbols too: say Y here to include all symbols, and you
-  don't care about adding 300k to the size of your kernel.
+  symbols too: say Y here to include all symbols, if you need them 
+  and you don't care about adding 300k to the size of your kernel.
 
   Say N.
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


uml: Make deb-pkg build target build a Debian-style user-mode-linux package

2005-09-06 Thread Linux Kernel Mailing List
tree a5c25447b4bea67871ef46cb43b25939e230a557
parent d80e22460968ec7986c82fd7d207ebe3de59e03d
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:24:00 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:24:00 +

uml: Make deb-pkg build target build a Debian-style user-mode-linux package

From: Ryan Anderson [EMAIL PROTECTED]

Make the deb-pkg build target understand the um arch and set up the
package and directory structure to match a mainline-Debian style
user-mode-linux package.

This is primarily so that it stops matching, exactly, the naming
convention used by normal, non-UML kernels generated by this command.

Installing linux-2.6.11 and linux-2.6.11, where one is a UML kernel
doesn't do the right thing.  This fixes that.

Signed-off-by: Ryan Anderson [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/package/builddeb |   32 ++--
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -14,18 +14,38 @@ set -e
 # Some variables and settings used throughout the script
 version=$KERNELRELEASE
 tmpdir=$objtree/debian/tmp
+packagename=linux-$version
+
+if [ $ARCH == um ] ; then
+   packagename=user-mode-linux-$version
+fi
 
 # Setup the directory structure
 rm -rf $tmpdir
 mkdir -p $tmpdir/DEBIAN $tmpdir/lib $tmpdir/boot
+if [ $ARCH == um ] ; then
+   mkdir -p $tmpdir/usr/lib/uml/modules/$version 
$tmpdir/usr/share/doc/$packagename $tmpdir/usr/bin
+fi
 
 # Build and install the kernel
-cp System.map $tmpdir/boot/System.map-$version
-cp .config $tmpdir/boot/config-$version
-cp $KBUILD_IMAGE $tmpdir/boot/vmlinuz-$version
+if [ $ARCH == um ] ; then
+   $MAKE linux
+   cp System.map $tmpdir/usr/lib/uml/modules/$version/System.map
+   cp .config $tmpdir/usr/share/doc/$packagename/config
+   gzip $tmpdir/usr/share/doc/$packagename/config
+   cp $KBUILD_IMAGE $tmpdir/usr/bin/linux-$version
+else 
+   cp System.map $tmpdir/boot/System.map-$version
+   cp .config $tmpdir/boot/config-$version
+   cp $KBUILD_IMAGE $tmpdir/boot/vmlinuz-$version
+fi
 
 if grep -q '^CONFIG_MODULES=y' .config ; then
INSTALL_MOD_PATH=$tmpdir make modules_install
+   if [ $ARCH == um ] ; then
+   mv $tmpdir/lib/modules/$version/* 
$tmpdir/usr/lib/uml/modules/$version/
+   rmdir $tmpdir/lib/modules/$version
+   fi
 fi
 
 # Install the maintainer scripts
@@ -60,11 +80,11 @@ Priority: optional
 Maintainer: $name
 Standards-Version: 3.6.1
 
-Package: linux-$version
+Package: $packagename
 Architecture: any
-Description: Linux kernel, version $version
+Description: Linux kernel, version $packagename
  This package contains the Linux kernel, modules and corresponding other
- files version $version.
+ files version $packagename
 EOF
 
 # Fix some ownership and permissions
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: silence mystery message

2005-09-06 Thread Linux Kernel Mailing List
tree 1e4a945d2a8f6f206eb0fb1ffcbecea730ae6663
parent 23a45e2c0a16bfd80eba853b44717d21c37bcf30
author Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 11:39:37 +0200
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 11:39:37 +0200

kbuild: silence mystery message

During last phase of the build the following message were displayed:
/bin/sh: +@: command not found

This message appears due to slightly changed semantics
of cmd and if_changed_rule.
The easy fix was to insert a dummy command first in rule_ksym_ld.
The alternative was to redo part of this processing in the top-level
Makefile - a volatile area that I try to avoid.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

 Makefile |2 ++
 1 files changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -688,8 +688,10 @@ endef
 
 # Update vmlinux version before link
 # Use + in front of this rule to silent warning about make -j1
+# First command is ':' to allow us to use + in front of this rule
 cmd_ksym_ld = $(cmd_vmlinux__)
 define rule_ksym_ld
+   : 
+$(call cmd,vmlinux_version)
$(call cmd,vmlinux__)
$(Q)echo 'cmd_$@ := $(cmd_vmlinux__)'  $(@D)/.$(@F).cmd
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: drop -Wundef from HOSTCFLAGS for now

2005-09-06 Thread Linux Kernel Mailing List
tree b9462262808ced29a000e041443e96a8e5f2aa7e
parent d178817803d95e4e3ca270bccd1ae2bed4780977
author Sam Ravnborg [EMAIL PROTECTED](none) Mon, 25 Jul 2005 12:40:34 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Mon, 25 Jul 2005 12:40:34 +

kbuild: drop -Wundef from HOSTCFLAGS for now

-Wundef caused warnings in the bison generated code in kconfig.
Updating to a newer bison (1.875d) did not fix it. The alternatives
was to correct the autogenerated code or drop -Wundef.
For now -Wundef is dropped from HOSTCFLAGS.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

 Makefile |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -203,7 +203,7 @@ CONFIG_SHELL := $(shell if [ -x $$BASH
 
 HOSTCC = gcc
 HOSTCXX= g++
-HOSTCFLAGS = -Wall -Wundef -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTCXXFLAGS   = -O2
 
 #  Decide whether to build built-in, modular, or both.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: Add target debug_kallsyms

2005-09-06 Thread Linux Kernel Mailing List
tree de59b867317a6e4d61c42d81c004520fd4b67fce
parent bd5bdd875b29e882f80d2cd6dd1da468641dad2a
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:19:08 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:19:08 +

kbuild: Add target debug_kallsyms

From: Keith Owens kaos@ocs.com.au

Make it easier to generate maps for debugging kallsyms problems.
debug_kallsyms is only a debugging target so no help or silent mode.

Signed-off-by: Keith Owens kaos@ocs.com.au
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 Makefile |   10 ++
 1 files changed, 10 insertions(+)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -722,6 +722,16 @@ quiet_cmd_kallsyms = KSYM$@
 # Needs to visit scripts/ before $(KALLSYMS) can be used.
 $(KALLSYMS): scripts ;
 
+# Generate some data for debugging strange kallsyms problems
+debug_kallsyms: .tmp_map$(last_kallsyms)
+
+.tmp_map%: .tmp_vmlinux% FORCE
+   ($(OBJDUMP) -h $ | $(AWK) '/^ +[0-9]/{print $$4  0  $$2}'; $(NM) $) 
| sort  $@
+
+.tmp_map3: .tmp_map2
+
+.tmp_map2: .tmp_map1
+
 endif # ifdef CONFIG_KALLSYMS
 
 # vmlinux image - including updated kernel symbols
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: Fix build as root then user

2005-09-06 Thread Linux Kernel Mailing List
tree d1ddaecfd623320c8a18ce6a0bc965f41e9a1e4b
parent 2283a117f65650352f2a9fd6b9af4cdbf5478d14
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:12:40 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:12:40 +

kbuild: Fix build as root then user

From: Matthew Wilcox [EMAIL PROTECTED]
I inadvertently built a tree as root and then rebuilt it as a user.  I
got a lot of prompts ...

mv: overwrite `drivers/char/drm/drm_auth.o', overriding mode 0644?

Using mv -f fixes that.

Signed-off-by: Matthew Wilcox [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/Makefile.build |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -169,7 +169,7 @@ cmd_modversions =   
\
-T $(@D)/.tmp_$(@F:.o=.ver);\
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver);\
else\
-   mv $(@D)/.tmp_$(@F) $@; \
+   mv -f $(@D)/.tmp_$(@F) $@;  \
fi;
 endif
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: Fix bug in make deb-pkg when using seperate source and output directories

2005-09-06 Thread Linux Kernel Mailing List
tree ba3589c5b2c72744f2584c98e0840c2d7b5a0bb8
parent dc5962fdf13f4d10a5fb8d0b0ae6f406ee8aed49
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:26:09 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:26:09 +

kbuild: Fix bug in make deb-pkg when using seperate source and output 
directories

From: Ryan Anderson [EMAIL PROTECTED]

When running make O=something deb-pkg, I get a failure that claims I
haven't configured my kernel (I have).  Running it a second time tells
me to run make mrproper  (include/linux/version.h got built on the
first run)

Original patch from:
From: Ajay Patel [EMAIL PROTECTED]

With modifications from:
Signed-off-By: Ryan Anderson [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/package/Makefile |4 ++--
 scripts/package/builddeb |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -59,7 +59,7 @@ $(objtree)/binkernel.spec: $(MKSPEC) $(s
$(CONFIG_SHELL) $(MKSPEC) prebuilt  $@

 binrpm-pkg: $(objtree)/binkernel.spec
-   $(MAKE)
+   $(MAKE) KBUILD_SRC=
set -e; \
$(CONFIG_SHELL) $(srctree)/scripts/mkversion  $(objtree)/.tmp_version
set -e; \
@@ -74,7 +74,7 @@ clean-files += $(objtree)/binkernel.spec
 #
 .PHONY: deb-pkg
 deb-pkg:
-   $(MAKE)
+   $(MAKE) KBUILD_SRC=
$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb
 
 clean-dirs += $(objtree)/debian/
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -41,7 +41,7 @@ else 
 fi
 
 if grep -q '^CONFIG_MODULES=y' .config ; then
-   INSTALL_MOD_PATH=$tmpdir make modules_install
+   INSTALL_MOD_PATH=$tmpdir make KBUILD_SRC= modules_install
if [ $ARCH == um ] ; then
mv $tmpdir/lib/modules/$version/* 
$tmpdir/usr/lib/uml/modules/$version/
rmdir $tmpdir/lib/modules/$version
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: fix make O=... build

2005-09-06 Thread Linux Kernel Mailing List
tree 293d04695b8c4946b4d2dea0333af79777611dba
parent a91f98a284321ffc9eb28ccfbf4329f7aa422f97
author Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:28:49 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Thu, 14 Jul 2005 20:28:49 +

kbuild: fix make O=... build

It fixes the following error:

make[1]: *** No rule to make target `include/asm', needed by 
`arch/alpha/kernel/asm-offsets.s'.  Stop.

Reported by:
From: Jan Dittmer [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -779,7 +779,7 @@ endif
 # prepare1 creates a makefile if using a separate output directory
 prepare1: prepare2 outputmakefile
 
-prepare0: prepare1 include/linux/version.h $(objtree)/include/asm \
+prepare0: prepare1 include/linux/version.h include/asm \
include/config/MARKER
 ifneq ($(KBUILD_MODULES),)
$(Q)rm -rf $(MODVERDIR)
@@ -819,7 +819,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$
 #  hard to detect, but I suppose make mrproper is a good idea
 #  before switching between archs anyway.
 
-$(objtree)/include/asm:
+include/asm:
@echo '  SYMLINK $@ - include/asm-$(ARCH)'
$(Q)if [ ! -d include ]; then mkdir -p include; fi;
@ln -fsn asm-$(ARCH) $@
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: signed/unsigned char fix for make menuconfig

2005-09-06 Thread Linux Kernel Mailing List
tree b43434c5f87f09aa093a592a1e6bda8cb80880c9
parent db8c1a7b2ca25f37b1429c00e82d6568f86caec1
author Keenan Pepper [EMAIL PROTECTED] Wed, 27 Jul 2005 22:14:00 -0400
committer Sam Ravnborg [EMAIL PROTECTED](none) Wed, 27 Jul 2005 22:17:30 +0200

[PATCH] kbuild: signed/unsigned char fix for make menuconfig

Quiet some silly warnings.
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 scripts/lxdialog/dialog.h   |2 +-
 scripts/lxdialog/inputbox.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/lxdialog/dialog.h b/scripts/lxdialog/dialog.h
--- a/scripts/lxdialog/dialog.h
+++ b/scripts/lxdialog/dialog.h
@@ -163,7 +163,7 @@ int dialog_menu (const char *title, cons
 int dialog_checklist (const char *title, const char *prompt, int height,
int width, int list_height, int item_no,
const char * const * items, int flag);
-extern unsigned char dialog_input_result[];
+extern char dialog_input_result[];
 int dialog_inputbox (const char *title, const char *prompt, int height,
int width, const char *init);
 
diff --git a/scripts/lxdialog/inputbox.c b/scripts/lxdialog/inputbox.c
--- a/scripts/lxdialog/inputbox.c
+++ b/scripts/lxdialog/inputbox.c
@@ -21,7 +21,7 @@
 
 #include dialog.h
 
-unsigned char dialog_input_result[MAX_LEN + 1];
+char dialog_input_result[MAX_LEN + 1];
 
 /*
  *  Print the termination buttons
@@ -48,7 +48,7 @@ dialog_inputbox (const char *title, cons
 {
 int i, x, y, box_y, box_x, box_width;
 int input_x = 0, scroll = 0, key = 0, button = -1;
-unsigned char *instr = dialog_input_result;
+char *instr = dialog_input_result;
 WINDOW *dialog;
 
 /* center dialog box on screen */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kbuild: drop descend - converting existing users

2005-09-06 Thread Linux Kernel Mailing List
tree 55451f57b3963421522a2662bc3d537f6b58f5cd
parent 43af5f23354dbd67d2fd2d523eefad8053ac388b
author Sam Ravnborg [EMAIL PROTECTED](none) Mon, 25 Jul 2005 12:51:08 +
committer Sam Ravnborg [EMAIL PROTECTED](none) Mon, 25 Jul 2005 12:51:08 +

kbuild: drop descend - converting existing users

There was only two users left of descend. Fix them so they
use $(clean)= and $(build)=.
Drop definition of descend.

Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]
---

 Makefile|5 -
 arch/m68knommu/Makefile |2 +-
 arch/mips/Makefile  |2 +-
 scripts/Makefile.lib|5 -
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1356,11 +1356,6 @@ build := -f $(if $(KBUILD_SRC),$(srctree
 # $(Q)$(MAKE) $(clean)=dir
 clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
 
-#  $(call descend,dir,target)
-#  Recursively call a sub-make in dir with target target
-# Usage is deprecated, because make does not see this as an invocation of make.
-descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build 
obj=$(1) $(2)
-
 endif  # skip-makefile
 
 FORCE:
diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile
--- a/arch/m68knommu/Makefile
+++ b/arch/m68knommu/Makefile
@@ -109,7 +109,7 @@ libs-y  += arch/m68knommu/lib/
 prepare: include/asm-$(ARCH)/asm-offsets.h
 
 archclean:
-   $(call descend arch/$(ARCH)/boot, subdirclean)
+   $(Q)$(MAKE) $(clean)=arch/m68knommu/boot
 
 include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
   include/asm include/linux/version.h \
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -683,7 +683,7 @@ drivers-$(CONFIG_OPROFILE)  += arch/mips/
 
 ifdef CONFIG_LASAT
 rom.bin rom.sw: vmlinux
-   $(call descend,arch/mips/lasat/image,$@)
+   $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@
 endif
 
 #
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -229,11 +229,6 @@ if_changed_rule = $(if $(strip $? $(call
 
 cmd = @$(if $($(quiet)cmd_$(1)),echo '  $(subst ','\'',$($(quiet)cmd_$(1)))' 
) $(cmd_$(1))
 
-#  $(call descend,dir,target)
-#  Recursively call a sub-make in dir with target target 
-# Usage is deprecated, because make do not see this as an invocation of make.
-descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build 
obj=$(1) $(2)
-
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
 # $(Q)$(MAKE) $(build)=dir
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] kbuild: When checking depmod version, redirect stderr

2005-09-06 Thread Linux Kernel Mailing List
tree 3fb8162df81441fe8cf9a20d0c3974595e04a3e9
parent 946dc121d7d1c606f6bbeb8ae778963a1e2ff59c
author Tom Rini [EMAIL PROTECTED] Fri, 15 Jul 2005 21:56:36 -0700
committer Sam Ravnborg [EMAIL PROTECTED](none) Sun, 17 Jul 2005 21:00:22 +

[PATCH] kbuild: When checking depmod version, redirect stderr

When running depmod to check for the correct version number, extra
output we don't need to see, such as depmod: QM_MODULES: Function not
implemented may show up.  Redirect stderr to /dev/null as the version
information that we do care about comes to stdout.

Signed-off-by: Tom Rini [EMAIL PROTECTED]
Signed-off-by: Sam Ravnborg [EMAIL PROTECTED]

 Makefile |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -886,7 +886,7 @@ modules_install: _modinst_ _modinst_post
 
 .PHONY: _modinst_
 _modinst_:
-   @if [ -z `$(DEPMOD) -V | grep module-init-tools` ]; then \
+   @if [ -z `$(DEPMOD) -V 2/dev/null | grep module-init-tools` ]; then \
echo Warning: you may need to install module-init-tools; \
echo See 
http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt;\
sleep 1; \
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Driver core: link device and all class devices derived from it.

2005-09-06 Thread Linux Kernel Mailing List
tree 153a44b7e0821d75b6dcd829a0648c62a5bc6fb9
parent d65da6eae10cc77f93ead0188cde0b45f124d912
author Dmitry Torokhov [EMAIL PROTECTED] Sun, 10 Jul 2005 11:21:24 -0500
committer Greg Kroah-Hartman [EMAIL PROTECTED] Tue, 06 Sep 2005 06:03:10 -0700

[PATCH] Driver core: link device and all class devices derived from it.

Driver core: link device and all class devices derived from it.

To ease the task of locating class devices derived from a certain
device create symlinks from parent device to its class devices.
Change USB host class device name from usbX to usb_hostX to avoid
conflict when creating aforementioned links.

Tweaked by Greg to have the symlink be class_name:class_device_name in
order to prevent duplicate links.

Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/base/class.c   |   33 +++--
 drivers/usb/core/hcd.c |2 +-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -452,10 +452,29 @@ void class_device_initialize(struct clas
INIT_LIST_HEAD(class_dev-node);
 }
 
+static char *make_class_name(struct class_device *class_dev)
+{
+   char *name;
+   int size;
+
+   size = strlen(class_dev-class-name) +
+   strlen(kobject_name(class_dev-kobj)) + 2;
+
+   name = kmalloc(size, GFP_KERNEL);
+   if (!name)
+   return ERR_PTR(-ENOMEM);
+
+   strcpy(name, class_dev-class-name);
+   strcat(name, :);
+   strcat(name, kobject_name(class_dev-kobj));
+   return name;
+}
+
 int class_device_add(struct class_device *class_dev)
 {
struct class * parent = NULL;
struct class_interface * class_intf;
+   char *class_name = NULL;
int error;
 
class_dev = class_device_get(class_dev);
@@ -500,9 +519,13 @@ int class_device_add(struct class_device
}
 
class_device_add_attrs(class_dev);
-   if (class_dev-dev)
+   if (class_dev-dev) {
+   class_name = make_class_name(class_dev);
sysfs_create_link(class_dev-kobj,
  class_dev-dev-kobj, device);
+   sysfs_create_link(class_dev-dev-kobj, class_dev-kobj,
+ class_name);
+   }
 
/* notify any interfaces this device is now here */
if (parent) {
@@ -519,6 +542,7 @@ int class_device_add(struct class_device
if (error  parent)
class_put(parent);
class_device_put(class_dev);
+   kfree(class_name);
return error;
 }
 
@@ -584,6 +608,7 @@ void class_device_del(struct class_devic
 {
struct class * parent = class_dev-class;
struct class_interface * class_intf;
+   char *class_name = NULL;
 
if (parent) {
down(parent-sem);
@@ -594,8 +619,11 @@ void class_device_del(struct class_devic
up(parent-sem);
}
 
-   if (class_dev-dev)
+   if (class_dev-dev) {
+   class_name = make_class_name(class_dev);
sysfs_remove_link(class_dev-kobj, device);
+   sysfs_remove_link(class_dev-dev-kobj, class_name);
+   }
if (class_dev-devt_attr)
class_device_remove_file(class_dev, class_dev-devt_attr);
class_device_remove_attrs(class_dev);
@@ -605,6 +633,7 @@ void class_device_del(struct class_devic
 
if (parent)
class_put(parent);
+   kfree(class_name);
 }
 
 void class_device_unregister(struct class_device *class_dev)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -782,7 +782,7 @@ static int usb_register_bus(struct usb_b
return -E2BIG;
}
 
-   bus-class_dev = class_device_create(usb_host_class, MKDEV(0,0), 
bus-controller, usb%d, busnum);
+   bus-class_dev = class_device_create(usb_host_class, MKDEV(0,0), 
bus-controller, usb_host%d, busnum);
if (IS_ERR(bus-class_dev)) {
clear_bit(busnum, busmap.busmap);
up(usb_bus_list_lock);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Floppy: add cmos attribute to floppy driver tidy

2005-09-06 Thread Linux Kernel Mailing List
tree 1e2fe584510f1af920b084cbbe1f2fe756508733
parent 94fd0db7bfb4a03da202fd426d4e8e7eab42ab86
author Andrew Morton [EMAIL PROTECTED] Thu, 28 Jul 2005 07:37:34 -0700
committer Greg Kroah-Hartman [EMAIL PROTECTED] Tue, 06 Sep 2005 06:03:11 -0700

[PATCH] Floppy: add cmos attribute to floppy driver tidy

Fiddle with coding style a bit.

Cc: Hannes Reinecke [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/block/floppy.c |   15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4193,17 +4193,16 @@ static int __init floppy_setup(char *str
 
 static int have_no_fdc = -ENODEV;
 
-static ssize_t floppy_cmos_show(struct device *dev, struct device_attribute 
*attr, char *buf)
+static ssize_t floppy_cmos_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
 {
-   struct platform_device *p = container_of(dev,struct 
platform_device,dev);
-   int drive = p-id;
-   ssize_t retval;
-
-   retval = sprintf(buf,%X\n, UDP-cmos);
+   struct platform_device *p;
+   int drive;
 
-   return retval;
+   p = container_of(dev, struct platform_device,dev);
+   drive = p-id;
+   return sprintf(buf, %X\n, UDP-cmos);
 }
-
 DEVICE_ATTR(cmos,S_IRUGO,floppy_cmos_show,NULL);
 
 static void floppy_device_release(struct device *dev)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Driver core: Documentation: fix whitespace between parameters

2005-09-06 Thread Linux Kernel Mailing List
tree 46e8e333421526be968e86da5cc0490fda3dde95
parent 9a8af6b3b64ee97a1aeecde017ffd02e6796913a
author Jan Veldeman [EMAIL PROTECTED] Sun, 31 Jul 2005 13:12:09 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Tue, 06 Sep 2005 06:03:12 -0700

[PATCH] Driver core: Documentation: fix whitespace between parameters

Fix whitespace after comma between parameters.

Signed-off-by: Jan Veldeman [EMAIL PROTECTED]
Signed-off-by: Domen Puncer [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/filesystems/sysfs.txt |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/filesystems/sysfs.txt 
b/Documentation/filesystems/sysfs.txt
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -90,7 +90,7 @@ void device_remove_file(struct device *,
 
 It also defines this helper for defining device attributes: 
 
-#define DEVICE_ATTR(_name,_mode,_show,_store)  \
+#define DEVICE_ATTR(_name, _mode, _show, _store)  \
 struct device_attribute dev_attr_##_name = {\
 .attr = {.name  = __stringify(_name) , .mode   = _mode },  \
 .show   = _show,\
@@ -99,7 +99,7 @@ struct device_attribute dev_attr_##_name
 
 For example, declaring
 
-static DEVICE_ATTR(foo,0644,show_foo,store_foo);
+static DEVICE_ATTR(foo, 0644, show_foo, store_foo);
 
 is equivalent to doing:
 
@@ -121,8 +121,8 @@ set of sysfs operations for forwarding r
 show and store methods of the attribute owners. 
 
 struct sysfs_ops {
-ssize_t (*show)(struct kobject *, struct attribute *,char *);
-ssize_t (*store)(struct kobject *,struct attribute *,const char *);
+ssize_t (*show)(struct kobject *, struct attribute *, char *);
+ssize_t (*store)(struct kobject *, struct attribute *, const char *);
 };
 
 [ Subsystems should have already defined a struct kobj_type as a
@@ -137,7 +137,7 @@ calls the associated methods. 
 
 To illustrate:
 
-#define to_dev_attr(_attr) container_of(_attr,struct device_attribute,attr)
+#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
 #define to_dev(d) container_of(d, struct device, kobj)
 
 static ssize_t
@@ -148,7 +148,7 @@ dev_attr_show(struct kobject * kobj, str
 ssize_t ret = 0;
 
 if (dev_attr-show)
-ret = dev_attr-show(dev,buf);
+ret = dev_attr-show(dev, buf);
 return ret;
 }
 
@@ -216,16 +216,16 @@ A very simple (and naive) implementation
 
 static ssize_t show_name(struct device *dev, struct device_attribute *attr, 
char *buf)
 {
-return sprintf(buf,%s\n,dev-name);
+   return snprintf(buf, PAGE_SIZE, %s\n, dev-name);
 }
 
 static ssize_t store_name(struct device * dev, const char * buf)
 {
-   sscanf(buf,%20s,dev-name);
-   return strlen(buf);
+   sscanf(buf, %20s, dev-name);
+   return strnlen(buf, PAGE_SIZE);
 }
 
-static DEVICE_ATTR(name,S_IRUGO,show_name,store_name);
+static DEVICE_ATTR(name, S_IRUGO, show_name, store_name);
 
 
 (Note that the real implementation doesn't allow userspace to set the 
@@ -290,7 +290,7 @@ struct device_attribute {
 
 Declaring:
 
-DEVICE_ATTR(_name,_str,_mode,_show,_store);
+DEVICE_ATTR(_name, _str, _mode, _show, _store);
 
 Creation/Removal:
 
@@ -310,7 +310,7 @@ struct bus_attribute {
 
 Declaring:
 
-BUS_ATTR(_name,_mode,_show,_store)
+BUS_ATTR(_name, _mode, _show, _store)
 
 Creation/Removal:
 
@@ -331,7 +331,7 @@ struct driver_attribute {
 
 Declaring:
 
-DRIVER_ATTR(_name,_mode,_show,_store)
+DRIVER_ATTR(_name, _mode, _show, _store)
 
 Creation/Removal:
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Driver core: hande sysdev suspend failure

2005-09-06 Thread Linux Kernel Mailing List
tree fafff19d6510ce06e229b4cbacc1023f6845a8f7
parent 91e49001b9a7fe5dc2fa5b56039fbca9aa638ccc
author Shaohua Li [EMAIL PROTECTED] Thu, 11 Aug 2005 10:37:39 +0800
committer Greg Kroah-Hartman [EMAIL PROTECTED] Tue, 06 Sep 2005 06:03:12 -0700

[PATCH] Driver core: hande sysdev suspend failure

This patch adds the return value check for sysdev suspend and does
restore in failure case. Send the patch to pm-list, but seems lost, so I
resend it.

Signed-off-by: Shaohua Li[EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/base/sys.c |  110 -
 1 files changed, 85 insertions(+), 25 deletions(-)

diff --git a/drivers/base/sys.c b/drivers/base/sys.c
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -288,6 +288,27 @@ void sysdev_shutdown(void)
up(sysdev_drivers_lock);
 }
 
+static void __sysdev_resume(struct sys_device *dev)
+{
+   struct sysdev_class *cls = dev-cls;
+   struct sysdev_driver *drv;
+
+   /* First, call the class-specific one */
+   if (cls-resume)
+   cls-resume(dev);
+
+   /* Call auxillary drivers next. */
+   list_for_each_entry(drv, cls-drivers, entry) {
+   if (drv-resume)
+   drv-resume(dev);
+   }
+
+   /* Call global drivers. */
+   list_for_each_entry(drv, sysdev_drivers, entry) {
+   if (drv-resume)
+   drv-resume(dev);
+   }
+}
 
 /**
  * sysdev_suspend - Suspend all system devices.
@@ -305,38 +326,93 @@ void sysdev_shutdown(void)
 int sysdev_suspend(pm_message_t state)
 {
struct sysdev_class * cls;
+   struct sys_device *sysdev, *err_dev;
+   struct sysdev_driver *drv, *err_drv;
+   int ret;
 
pr_debug(Suspending System Devices\n);
 
list_for_each_entry_reverse(cls, system_subsys.kset.list,
kset.kobj.entry) {
-   struct sys_device * sysdev;
 
pr_debug(Suspending type '%s':\n,
 kobject_name(cls-kset.kobj));
 
list_for_each_entry(sysdev, cls-kset.list, kobj.entry) {
-   struct sysdev_driver * drv;
pr_debug( %s\n, kobject_name(sysdev-kobj));
 
/* Call global drivers first. */
list_for_each_entry(drv, sysdev_drivers, entry) {
-   if (drv-suspend)
-   drv-suspend(sysdev, state);
+   if (drv-suspend) {
+   ret = drv-suspend(sysdev, state);
+   if (ret)
+   goto gbl_driver;
+   }
}
 
/* Call auxillary drivers next. */
list_for_each_entry(drv, cls-drivers, entry) {
-   if (drv-suspend)
-   drv-suspend(sysdev, state);
+   if (drv-suspend) {
+   ret = drv-suspend(sysdev, state);
+   if (ret)
+   goto aux_driver;
+   }
}
 
/* Now call the generic one */
-   if (cls-suspend)
-   cls-suspend(sysdev, state);
+   if (cls-suspend) {
+   ret = cls-suspend(sysdev, state);
+   if (ret)
+   goto cls_driver;
+   }
}
}
return 0;
+   /* resume current sysdev */
+cls_driver:
+   drv = NULL;
+   printk(KERN_ERR Class suspend failed for %s\n,
+   kobject_name(sysdev-kobj));
+
+aux_driver:
+   if (drv)
+   printk(KERN_ERR Class driver suspend failed for %s\n,
+   kobject_name(sysdev-kobj));
+   list_for_each_entry(err_drv, cls-drivers, entry) {
+   if (err_drv == drv)
+   break;
+   if (err_drv-resume)
+   err_drv-resume(sysdev);
+   }
+   drv = NULL;
+
+gbl_driver:
+   if (drv)
+   printk(KERN_ERR sysdev driver suspend failed for %s\n,
+   kobject_name(sysdev-kobj));
+   list_for_each_entry(err_drv, sysdev_drivers, entry) {
+   if (err_drv == drv)
+   break;
+   if (err_drv-resume)
+   err_drv-resume(sysdev);
+   }
+   /* resume other sysdevs in current class */
+   list_for_each_entry(err_dev, cls-kset.list, kobj.entry) {
+   if (err_dev == sysdev)
+   break;
+   pr_debug( %s\n, 

[PATCH] I2C: update max6875 documentation

2005-09-06 Thread Linux Kernel Mailing List
tree 451f9bdfa2ec7e2c4399dd6ca3cc3c97f12c27b9
parent bc769ff8f5f6e3d249bfde082653e5bf1c2b5698
author [EMAIL PROTECTED] [EMAIL PROTECTED] Tue, 12 Jul 2005 23:21:50 -0500
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:03 -0700

[PATCH] I2C: update max6875 documentation

Updates to the max6875 driver documentation.
This brings the documentation in sync with the code, which was recently
simplified.

This patch is based off 2.6.13-rc2-mm2.

Signed-off-by: Ben Gardner [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/chips/max6875 |   94 
 1 files changed, 68 insertions(+), 26 deletions(-)

diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/i2c/chips/max6875
@@ -4,22 +4,13 @@ Kernel driver max6875
 Supported chips:
   * Maxim MAX6874, MAX6875
 Prefix: 'max6875'
-Addresses scanned: 0x50, 0x52
+Addresses scanned: None (see below)
 Datasheet:
 http://pdfserv.maxim-ic.com/en/ds/MAX6874-MAX6875.pdf
 
 Author: Ben Gardner [EMAIL PROTECTED]
 
 
-Module Parameters
--
-
-* allow_write int
-  Set to non-zero to enable write permission:
-  *0: Read only
-   1: Read and write
-
-
 Description
 ---
 
@@ -33,34 +24,85 @@ registers.
 
 The Maxim MAX6874 is a similar, mostly compatible device, with more intputs
 and outputs:
-
  vin gpivout
 MAX68746   4   8
 MAX68754   3   5
 
-MAX6874 chips can have four different addresses (as opposed to only two for
-the MAX6875). The additional addresses (0x54 and 0x56) are not probed by
-this driver by default, but the probe module parameter can be used if
-needed.
-
-See the datasheet for details on how to program the EEPROM.
+See the datasheet for more information.
 
 
 Sysfs entries
 -
 
-eeprom_user   - 512 bytes of user-defined EEPROM space. Only writable if
-allow_write was set and register 0x43 is 0.
-
-eeprom_config - 70 bytes of config EEPROM. Note that changes will not get
-loaded into register space until a power cycle or device reset.
-
-reg_config- 70 bytes of register space. Any changes take affect 
immediately.
+eeprom- 512 bytes of user-defined EEPROM space.
 
 
 General Remarks
 ---
 
-A typical application will require that the EEPROMs be programmed once and
-never altered afterwards.
+Valid addresses for the MAX6875 are 0x50 and 0x52.
+Valid addresses for the MAX6874 are 0x50, 0x52, 0x54 and 0x56.
+The driver does not probe any address, so you must force the address.
+
+Example:
+$ modprobe max6875 force=0,0x50
+
+The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
+addresses.  For example, for address 0x50, it also reserves 0x51.
+The even-address instance is called 'max6875', the odd one is 'max6875-dummy'.
+
+
+Programming the chip using i2c-dev
+--
+
+Use the i2c-dev interface to access and program the chips.
+Reads and write are performed differently depending on the address range.
+
+The configuration registers are at addresses 0x00 - 0x45.
+Use i2c_smbus_write_byte_data() to write a register and
+i2c_smbus_read_byte_data() to read a register.
+The command is the register number.
+
+Examples:
+To write a 1 to register 0x45:
+  i2c_smbus_write_byte_data(fd, 0x45, 1);
+
+To read register 0x45:
+  value = i2c_smbus_read_byte_data(fd, 0x45);
+
+
+The configuration EEPROM is at addresses 0x8000 - 0x8045.
+The user EEPROM is at addresses 0x8100 - 0x82ff.
+
+Use i2c_smbus_write_word_data() to write a byte to EEPROM.
+
+The command is the upper byte of the address: 0x80, 0x81, or 0x82.
+The data word is the lower part of the address or'd with data  8.
+  cmd = address  8;
+  val = (address  0xff) | (data  8);
+
+Example:
+To write 0x5a to address 0x8003:
+  i2c_smbus_write_word_data(fd, 0x80, 0x5a03);
+
+
+Reading data from the EEPROM is a little more complicated.
+Use i2c_smbus_write_byte_data() to set the read address and then
+i2c_smbus_read_byte() or i2c_smbus_read_i2c_block_data() to read the data.
+
+Example:
+To read data starting at offset 0x8100, first set the address:
+  i2c_smbus_write_byte_data(fd, 0x81, 0x00);
+
+And then read the data
+  value = i2c_smbus_read_byte(fd);
+
+  or
+
+  count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer);
+
+The block read should read 16 bytes.
+0x84 is the block read command.
+
+See the datasheet for more details.
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: fix max6875 build error

2005-09-06 Thread Linux Kernel Mailing List
tree d7e10599ca2b1ba2e992dd11c327fabdd2c45039
parent 93ffa435147abd47ebd7d7d24176b3c653aef940
author Greg Kroah-Hartman [EMAIL PROTECTED] Wed, 27 Jul 2005 22:43:03 -0500
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:04 -0700

[PATCH] I2C: fix max6875 build error

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/chips/max6875.c |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c
--- a/drivers/i2c/chips/max6875.c
+++ b/drivers/i2c/chips/max6875.c
@@ -93,8 +93,7 @@ static void max6875_update_slice(struct 
if (!(data-valid  (1  slice)) ||
time_after(jiffies, data-last_updated[slice])) {
 
-   dev_dbg(client-dev, Starting update of slice %u\n,
-   slice, blk-base);
+   dev_dbg(client-dev, Starting update of slice %u\n, slice);
 
data-valid = ~(1  slice);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: cleanup of i2c-nforce2

2005-09-06 Thread Linux Kernel Mailing List
tree 8be76d0a5c08d37230ecd66c06d08d39650b4d31
parent a8decc658a8800e61f13b9240125f2a34d7fd3f5
author Hans-Frieder Vogt [EMAIL PROTECTED] Sat, 23 Jul 2005 15:33:39 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:04 -0700

[PATCH] I2C: cleanup of i2c-nforce2

attached is a small patch that removes unused code from i2c-nforce2 and
adds a single debug message. The patch is against 2.6.13-rc3-mm1.
I have tested the patch with 2.6.13-rc3: compiles cleanly and works as
without the patch (as expected).

Signed-off-by: Hans-Frieder Vogt [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/busses/i2c-nforce2.c |   31 +++
 1 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -131,7 +131,6 @@ static s32 nforce2_access(struct i2c_ada
struct nforce2_smbus *smbus = adap-algo_data;
unsigned char protocol, pec, temp;
unsigned char len = 0; /* to keep the compiler quiet */
-   int timeout = 0;
int i;
 
protocol = (read_write == I2C_SMBUS_READ) ? NVIDIA_SMB_PRTCL_READ :
@@ -191,29 +190,10 @@ static s32 nforce2_access(struct i2c_ada
case I2C_SMBUS_PROC_CALL:
dev_err(adap-dev, I2C_SMBUS_PROC_CALL not 
supported!\n);
return -1;
-   /*
-   outb_p(command, NVIDIA_SMB_CMD);
-   outb_p(data-word, NVIDIA_SMB_DATA);
-   outb_p(data-word  8, NVIDIA_SMB_DATA + 1);
-   protocol = NVIDIA_SMB_PRTCL_PROC_CALL | pec;
-   read_write = I2C_SMBUS_READ;
-   break;
-*/
 
case I2C_SMBUS_BLOCK_PROC_CALL:
dev_err(adap-dev, I2C_SMBUS_BLOCK_PROC_CALL not 
supported!\n);
return -1;
-   /*
-   protocol |= pec;
-   len = min_t(u8, data-block[0], 31);
-   outb_p(command, NVIDIA_SMB_CMD);
-   outb_p(len, NVIDIA_SMB_BCNT);
-   for (i = 0; i  len; i++)
-   outb_p(data-block[i + 1], NVIDIA_SMB_DATA + i);
-   protocol = NVIDIA_SMB_PRTCL_BLOCK_PROC_CALL | pec;
-   read_write = I2C_SMBUS_READ;
-   break;
-   */
 
case I2C_SMBUS_WORD_DATA_PEC:
case I2C_SMBUS_BLOCK_DATA_PEC:
@@ -232,12 +212,6 @@ static s32 nforce2_access(struct i2c_ada
 
temp = inb_p(NVIDIA_SMB_STS);
 
-#if 0
-   do {
-   i2c_do_pause(1);
-   temp = inb_p(NVIDIA_SMB_STS);
-   } while (((temp  NVIDIA_SMB_STS_DONE) == 0)  (timeout++  
MAX_TIMEOUT));
-#endif
if (~temp  NVIDIA_SMB_STS_DONE) {
udelay(500);
temp = inb_p(NVIDIA_SMB_STS);
@@ -247,9 +221,10 @@ static s32 nforce2_access(struct i2c_ada
temp = inb_p(NVIDIA_SMB_STS);
}
 
-   if ((timeout = MAX_TIMEOUT) || (~temp  NVIDIA_SMB_STS_DONE)
-   || (temp  NVIDIA_SMB_STS_STATUS))
+   if ((~temp  NVIDIA_SMB_STS_DONE) || (temp  NVIDIA_SMB_STS_STATUS)) {
+   dev_dbg(adap-dev, SMBus Timeout! (0x%02x)\n, temp);
return -1;
+   }
 
if (read_write == I2C_SMBUS_WRITE)
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: max6875 documentation cleanup

2005-09-06 Thread Linux Kernel Mailing List
tree df4e86f58dc1708606ad09d8aea7a872d7d1a8fe
parent a61fc683ae1b7871d8d81ac5025af1a923731547
author [EMAIL PROTECTED] [EMAIL PROTECTED] Wed, 27 Jul 2005 22:43:21 -0500
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:05 -0700

[PATCH] I2C: max6875 documentation cleanup

Fix a spelling error and change a sysfs name.

Signed-off-by: Ben Gardner [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/chips/max6875 |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/i2c/chips/max6875 b/Documentation/i2c/chips/max6875
--- a/Documentation/i2c/chips/max6875
+++ b/Documentation/i2c/chips/max6875
@@ -49,14 +49,14 @@ $ modprobe max6875 force=0,0x50
 
 The MAX6874/MAX6875 ignores address bit 0, so this driver attaches to multiple
 addresses.  For example, for address 0x50, it also reserves 0x51.
-The even-address instance is called 'max6875', the odd one is 'max6875-dummy'.
+The even-address instance is called 'max6875', the odd one is 'max6875 
subclient'.
 
 
 Programming the chip using i2c-dev
 --
 
 Use the i2c-dev interface to access and program the chips.
-Reads and write are performed differently depending on the address range.
+Reads and writes are performed differently depending on the address range.
 
 The configuration registers are at addresses 0x00 - 0x45.
 Use i2c_smbus_write_byte_data() to write a register and
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: soften lm75 initialization

2005-09-06 Thread Linux Kernel Mailing List
tree c1892aa10ee99705e706680760d6bf247e5914af
parent 17f990c87a1e5addc49b99a53b3d2a2fac9680e9
author Jean Delvare [EMAIL PROTECTED] Wed, 27 Jul 2005 21:28:28 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:06 -0700

[PATCH] hwmon: soften lm75 initialization

The LM75 initialization is a bit agressive, it arbitrarily reconfigures
the chip. Make it only change the bit it needs. This is a port from
the 2.4 kernel version of the driver (lm_sensors).

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/lm75.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -251,8 +251,12 @@ static int lm75_write_value(struct i2c_c
 
 static void lm75_init_client(struct i2c_client *client)
 {
-   /* Initialize the LM75 chip */
-   lm75_write_value(client, LM75_REG_CONF, 0);
+   int reg;
+
+   /* Enable if in shutdown mode */
+   reg = lm75_read_value(client, LM75_REG_CONF);
+   if (reg = 0  (reg  0x01))
+   lm75_write_value(client, LM75_REG_CONF, reg  0xfe);
 }
 
 static struct lm75_data *lm75_update_device(struct device *dev)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: kill client name lm78-j

2005-09-06 Thread Linux Kernel Mailing List
tree 8207b9c242c9c15e2fe7887e715668b180e9e775
parent e647ecf15e365679f0528d7815ab4db0d4802918
author Jean Delvare [EMAIL PROTECTED] Wed, 27 Jul 2005 21:30:16 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:06 -0700

[PATCH] hwmon: kill client name lm78-j

Drop the separate client name for the LM78-J chip. This is really
only a later revision of the LM78, with almost no difference and
no difference the driver handles in any case.

This was the only client name that had a dash in it, and special care
had to be taken in libsensors because of it. As we plan to write a new
library soon, I'd like to get rid of this exception before we do.

As a nice side effect, it saves 876 bytes in lm78.ko.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/hwmon/lm78 |7 +--
 drivers/hwmon/lm78.c |   11 ---
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/Documentation/hwmon/lm78 b/Documentation/hwmon/lm78
--- a/Documentation/hwmon/lm78
+++ b/Documentation/hwmon/lm78
@@ -2,16 +2,11 @@ Kernel driver lm78
 ==
 
 Supported chips:
-  * National Semiconductor LM78
+  * National Semiconductor LM78 / LM78-J
 Prefix: 'lm78'
 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
 Datasheet: Publicly available at the National Semiconductor website
http://www.national.com/
-  * National Semiconductor LM78-J
-Prefix: 'lm78-j'
-Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
-Datasheet: Publicly available at the National Semiconductor website
-   http://www.national.com/
   * National Semiconductor LM79
 Prefix: 'lm79'
 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -34,7 +34,7 @@ static unsigned short normal_i2c[] = { 0
 static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };
 
 /* Insmod parameters */
-SENSORS_INSMOD_3(lm78, lm78j, lm79);
+SENSORS_INSMOD_2(lm78, lm79);
 
 /* Many LM78 constants specified below */
 
@@ -559,10 +559,9 @@ int lm78_detect(struct i2c_adapter *adap
/* Determine the chip type. */
if (kind = 0) {
i = lm78_read_value(new_client, LM78_REG_CHIPID);
-   if (i == 0x00 || i == 0x20)
+   if (i == 0x00 || i == 0x20  /* LM78 */
+|| i == 0x40)  /* LM78-J */
kind = lm78;
-   else if (i == 0x40)
-   kind = lm78j;
else if ((i  0xfe) == 0xc0)
kind = lm79;
else {
@@ -578,8 +577,6 @@ int lm78_detect(struct i2c_adapter *adap
 
if (kind == lm78) {
client_name = lm78;
-   } else if (kind == lm78j) {
-   client_name = lm78-j;
} else if (kind == lm79) {
client_name = lm79;
}
@@ -788,7 +785,7 @@ static void __exit sm_lm78_exit(void)
 
 
 MODULE_AUTHOR(Frodo Looijaard [EMAIL PROTECTED]);
-MODULE_DESCRIPTION(LM78, LM78-J and LM79 driver);
+MODULE_DESCRIPTION(LM78/LM79 driver);
 MODULE_LICENSE(GPL);
 
 module_init(sm_lm78_init);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: Document on the W83627EHG chip

2005-09-06 Thread Linux Kernel Mailing List
tree b215d20fd866d3efa75d71a5ddd31cab029e34c8
parent 27fe048eb3787d29bf9cf9d6d12077bb8af869a6
author Jean Delvare [EMAIL PROTECTED] Wed, 27 Jul 2005 21:33:15 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:07 -0700

[PATCH] hwmon: Document on the W83627EHG chip

Document the fact that the W83627EHG is compatible with the W83627EHF.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/Kconfig |3 +++
 drivers/hwmon/w83627ehf.c |3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -404,6 +404,9 @@ config SENSORS_W83627EHF
  Only fan and temperature inputs are supported at the moment, while
  the chip does much more than that.
 
+ This driver also supports the W83627EHG, which is the lead-free
+ version of the W83627EHF.
+
  This driver can also be built as a module.  If so, the module
  will be called w83627ehf.
 
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -9,6 +9,9 @@
 Thanks to Leon Moonen, Steve Cliffe and Grant Coady for their help
 in testing and debugging this driver.
 
+This driver also supports the W83627EHG, which is the lead-free
+version of the W83627EHF.
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C hwmon: add hwmon sysfs class to drivers

2005-09-06 Thread Linux Kernel Mailing List
tree 1963da8d8867069617404a8f92739035c6faca02
parent 1236441f38b6a98caf4c7983e7efdecc2d1527b5
author Mark M. Hoffman [EMAIL PROTECTED] Sat, 16 Jul 2005 05:39:18 -0400
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:08 -0700

[PATCH] I2C hwmon: add hwmon sysfs class to drivers

This patch modifies sensors chip drivers to make use of the new
sysfs class hwmon.

Signed-off-by: Mark M. Hoffman [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/adm1021.c|   16 +++-
 drivers/hwmon/adm1025.c|   16 +++-
 drivers/hwmon/adm1026.c|   15 ++-
 drivers/hwmon/adm1031.c|   16 +++-
 drivers/hwmon/adm9240.c|   17 -
 drivers/hwmon/asb100.c |   31 +--
 drivers/hwmon/atxp1.c  |   16 +++-
 drivers/hwmon/ds1621.c |   16 +++-
 drivers/hwmon/fscher.c |   16 +++-
 drivers/hwmon/fscpos.c |   16 +++-
 drivers/hwmon/gl518sm.c|   17 +++--
 drivers/hwmon/gl520sm.c|   16 +++-
 drivers/hwmon/it87.c   |   16 +++-
 drivers/hwmon/lm63.c   |   16 +++-
 drivers/hwmon/lm75.c   |   15 ++-
 drivers/hwmon/lm77.c   |   16 ++--
 drivers/hwmon/lm78.c   |   16 +++-
 drivers/hwmon/lm80.c   |   16 +++-
 drivers/hwmon/lm83.c   |   16 +++-
 drivers/hwmon/lm85.c   |   15 ++-
 drivers/hwmon/lm87.c   |   16 +++-
 drivers/hwmon/lm90.c   |   16 +++-
 drivers/hwmon/lm92.c   |   17 +++--
 drivers/hwmon/max1619.c|   17 +++--
 drivers/hwmon/pc87360.c|   13 +
 drivers/hwmon/sis5595.c|   18 --
 drivers/hwmon/smsc47b397.c |   16 +++-
 drivers/hwmon/smsc47m1.c   |   17 -
 drivers/hwmon/via686a.c|   24 +++-
 drivers/hwmon/w83627ehf.c  |   16 +++-
 drivers/hwmon/w83627hf.c   |   16 +++-
 drivers/hwmon/w83781d.c|   39 +++
 drivers/hwmon/w83l785ts.c  |   16 +++-
 33 files changed, 522 insertions(+), 53 deletions(-)

diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -25,6 +25,8 @@
 #include linux/jiffies.h
 #include linux/i2c.h
 #include linux/i2c-sensor.h
+#include linux/hwmon.h
+#include linux/err.h
 
 
 /* Addresses to scan */
@@ -89,6 +91,7 @@ clearing it.  Weird, ey?   --Phil  */
 /* Each client has this additional data */
 struct adm1021_data {
struct i2c_client client;
+   struct class_device *class_dev;
enum chips type;
 
struct semaphore update_lock;
@@ -295,6 +298,12 @@ static int adm1021_detect(struct i2c_ada
adm1021_init_client(new_client);
 
/* Register sysfs hooks */
+   data-class_dev = hwmon_device_register(new_client-dev);
+   if (IS_ERR(data-class_dev)) {
+   err = PTR_ERR(data-class_dev);
+   goto error2;
+   }
+
device_create_file(new_client-dev, dev_attr_temp1_max);
device_create_file(new_client-dev, dev_attr_temp1_min);
device_create_file(new_client-dev, dev_attr_temp1_input);
@@ -305,6 +314,8 @@ static int adm1021_detect(struct i2c_ada
 
return 0;
 
+error2:
+   i2c_detach_client(new_client);
 error1:
kfree(data);
 error0:
@@ -322,14 +333,17 @@ static void adm1021_init_client(struct i
 
 static int adm1021_detach_client(struct i2c_client *client)
 {
+   struct adm1021_data *data = i2c_get_clientdata(client);
int err;
 
+   hwmon_device_unregister(data-class_dev);
+
if ((err = i2c_detach_client(client))) {
dev_err(client-dev, Client deregistration failed, client not 
detached.\n);
return err;
}
 
-   kfree(i2c_get_clientdata(client));
+   kfree(data);
return 0;
 }
 
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -52,6 +52,8 @@
 #include linux/i2c.h
 #include linux/i2c-sensor.h
 #include linux/i2c-vid.h
+#include linux/hwmon.h
+#include linux/err.h
 
 /*
  * Addresses to scan
@@ -132,6 +134,7 @@ static struct i2c_driver adm1025_driver 
 
 struct adm1025_data {
struct i2c_client client;
+   struct class_device *class_dev;
struct semaphore update_lock;
char valid; /* zero until following fields are valid */
unsigned long last_updated; /* in jiffies */
@@ -416,6 +419,12 @@ static int adm1025_detect(struct i2c_ada
adm1025_init_client(new_client);
 
/* Register sysfs hooks */
+   data-class_dev = hwmon_device_register(new_client-dev);
+   if (IS_ERR(data-class_dev)) {
+   

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9)

2005-09-06 Thread Linux Kernel Mailing List
tree 31e5cff31af33f38dfdcaa65cebd935f2a3f7fdc
parent 943b0830cebe4711354945ed3cb44e84152aaca0
author Jean Delvare [EMAIL PROTECTED] Wed, 20 Jul 2005 23:03:50 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:09 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9)

Temporarily export a few structures and functions from i2c-core, because we
will soon need them in i2c-isa.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/i2c-core.c |   14 ++
 include/linux/i2c.h|7 +++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -61,7 +61,7 @@ static int i2c_bus_resume(struct device 
return rc;
 }
 
-static struct bus_type i2c_bus_type = {
+struct bus_type i2c_bus_type = {
.name = i2c,
.match =i2c_device_match,
.suspend =  i2c_bus_suspend,
@@ -78,13 +78,13 @@ static int i2c_device_remove(struct devi
return 0;
 }
 
-static void i2c_adapter_dev_release(struct device *dev)
+void i2c_adapter_dev_release(struct device *dev)
 {
struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
complete(adap-dev_released);
 }
 
-static struct device_driver i2c_adapter_driver = {
+struct device_driver i2c_adapter_driver = {
.name = i2c_adapter,
.bus = i2c_bus_type,
.probe = i2c_device_probe,
@@ -97,7 +97,7 @@ static void i2c_adapter_class_dev_releas
complete(adap-class_dev_released);
 }
 
-static struct class i2c_adapter_class = {
+struct class i2c_adapter_class = {
.name = i2c-adapter,
.release =  i2c_adapter_class_dev_release,
 };
@@ -1171,6 +1171,12 @@ s32 i2c_smbus_xfer(struct i2c_adapter * 
 }
 
 
+/* Next four are needed by i2c-isa */
+EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);
+EXPORT_SYMBOL_GPL(i2c_adapter_driver);
+EXPORT_SYMBOL_GPL(i2c_adapter_class);
+EXPORT_SYMBOL_GPL(i2c_bus_type);
+
 EXPORT_SYMBOL(i2c_add_adapter);
 EXPORT_SYMBOL(i2c_del_adapter);
 EXPORT_SYMBOL(i2c_add_driver);
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,13 @@
 #include linux/device.h  /* for struct device */
 #include asm/semaphore.h
 
+/* --- For i2c-isa  */
+
+extern void i2c_adapter_dev_release(struct device *dev);
+extern struct device_driver i2c_adapter_driver;
+extern struct class i2c_adapter_class;
+extern struct bus_type i2c_bus_type;
+
 /* --- General options 
*/
 
 struct i2c_msg;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9)

2005-09-06 Thread Linux Kernel Mailing List
tree d8cbad347ec31ded7cac38ae18be71c9218cfcd6
parent efde723fdac02111872bff606ef362074fc1efa8
author Jean Delvare [EMAIL PROTECTED] Tue, 19 Jul 2005 23:48:43 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:09 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9)

Convert i2c-isa from a dumb i2c_adapter into a pseudo i2c-core for ISA
hardware monitoring drivers. The isa i2c_adapter is no more registered
with i2c-core, drivers have to explicitely connect to it using the new
i2c_isa_{add,del}_driver interface.

At this point, all ISA chip drivers are useless, because they still
register with i2c-core in the hope i2c-isa is registered there as well,
but it isn't anymore.

The fake bus will be named i2c-9191 in sysfs. This is the number it
already had internally in various places, so it's not exactly new,
except that now the number is seen in userspace as well. This shouldn't
be a problem until someone really has 9192 I2C busses in a given system
;)

The fake bus will no more show in i2cdetect -l, as it won't be seen by
i2c-dev anymore (not being registered with i2c-core), which is a good
thing, as i2cdetect/i2cdump/i2cset cannot operate on this fake bus
anyway.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/busses/i2c-isa.c |  158 ---
 include/linux/i2c-isa.h  |   29 +++
 2 files changed, 177 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -1,6 +1,8 @@
 /*
-i2c-isa.c - Part of lm_sensors, Linux kernel modules for hardware
-monitoring
+i2c-isa.c - an i2c-core-like thing for ISA hardware monitoring chips
+Copyright (C) 2005  Jean Delvare [EMAIL PROTECTED]
+
+Based on the i2c-isa pseudo-adapter from the lm_sensors project
 Copyright (c) 1998, 1999  Frodo Looijaard [EMAIL PROTECTED] 
 
 This program is free software; you can redistribute it and/or modify
@@ -18,17 +20,24 @@
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/* This implements an i2c algorithm/adapter for ISA bus. Not that this is
-   on first sight very useful; almost no functionality is preserved.
-   Except that it makes writing drivers for chips which can be on both
-   the SMBus and the ISA bus very much easier. See lm78.c for an example
-   of this. */
+/* This implements an i2c-core-like thing for ISA hardware monitoring
+   chips. Such chips are linked to the i2c subsystem for historical
+   reasons (because the early ISA hardware monitoring chips such as the
+   LM78 had both an I2C and an ISA interface). They used to be
+   registered with the main i2c-core, but as a first step in the
+   direction of a clean separation between I2C and ISA chip drivers,
+   we now have this separate core for ISA ones. It is significantly
+   more simple than the real one, of course, because we don't have to
+   handle multiple busses: there is only one (fake) ISA adapter.
+   It is worth noting that we still rely on i2c-core for some things
+   at the moment - but hopefully this won't last. */
 
 #include linux/init.h
 #include linux/module.h
 #include linux/kernel.h
 #include linux/errno.h
 #include linux/i2c.h
+#include linux/i2c-isa.h
 
 static u32 isa_func(struct i2c_adapter *adapter);
 
@@ -53,17 +62,146 @@ static u32 isa_func(struct i2c_adapter *
return 0;
 }
 
+
+/* Copied from i2c-core */
+static ssize_t show_adapter_name(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
+   return sprintf(buf, %s\n, adap-name);
+}
+static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
+
+static int i2c_isa_device_probe(struct device *dev)
+{
+   return -ENODEV;
+}
+
+static int i2c_isa_device_remove(struct device *dev)
+{
+   return 0;
+}
+
+
+/* We implement an interface which resembles i2c_{add,del}_driver,
+   but for i2c-isa drivers. We don't have to remember and handle lists
+   of drivers and adapters so this is much more simple, of course. */
+
+int i2c_isa_add_driver(struct i2c_driver *driver)
+{
+   int res;
+
+   /* Add the driver to the list of i2c drivers in the driver core */
+   driver-driver.name = driver-name;
+   driver-driver.bus = i2c_bus_type;
+   driver-driver.probe = i2c_isa_device_probe;
+   driver-driver.remove = i2c_isa_device_remove;
+   res = driver_register(driver-driver);
+   if (res)
+   return res;
+   dev_dbg(isa_adapter.dev, Driver %s registered\n, driver-name);
+
+   /* Now look for clients */
+   driver-attach_adapter(isa_adapter);
+
+   return 0;
+}
+
+int i2c_isa_del_driver(struct i2c_driver *driver)
+{
+   struct list_head *item, *_n;
+   struct i2c_client *client;
+   int res;
+
+   /* Detach all clients belonging to this one driver */
+  

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (3/9)

2005-09-06 Thread Linux Kernel Mailing List
tree 5a970459793ac46ad7082f0d722616730b0589c2
parent 400c455eaa0d0819d18cd42a74070e0e238a73dc
author Jean Delvare [EMAIL PROTECTED] Tue, 19 Jul 2005 23:51:07 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:09 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (3/9)

Convert the 10 ISA hardware monitoring drivers (it87, lm78, pc87360,
sis5595, smsc47b397, smsc47m1, via686a, w83627hf, w83627ehf, w83781d) to
explicitely register with i2c-isa. For hybrid drivers (it87, lm78,
w83781d), we now have two separate instances of i2c_driver, one for the
I2C interface of the chip, and one for ISA interface. In the long run,
the one for ISA will be replaced with a different driver type.

At this point, all drivers are working again, except for missing
dependencies in Kconfig.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/it87.c   |   29 +
 drivers/hwmon/lm78.c   |   29 ++---
 drivers/hwmon/pc87360.c|5 +++--
 drivers/hwmon/sis5595.c|5 +++--
 drivers/hwmon/smsc47b397.c |5 +++--
 drivers/hwmon/smsc47m1.c   |5 +++--
 drivers/hwmon/via686a.c|5 +++--
 drivers/hwmon/w83627ehf.c  |5 +++--
 drivers/hwmon/w83627hf.c   |5 +++--
 drivers/hwmon/w83781d.c|   28 +---
 10 files changed, 97 insertions(+), 24 deletions(-)

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -36,6 +36,7 @@
 #include linux/slab.h
 #include linux/jiffies.h
 #include linux/i2c.h
+#include linux/i2c-isa.h
 #include linux/i2c-sensor.h
 #include linux/i2c-vid.h
 #include linux/hwmon-sysfs.h
@@ -242,6 +243,14 @@ static struct i2c_driver it87_driver = {
.detach_client  = it87_detach_client,
 };
 
+static struct i2c_driver it87_isa_driver = {
+   .owner  = THIS_MODULE,
+   .name   = it87-isa,
+   .attach_adapter = it87_attach_adapter,
+   .detach_client  = it87_detach_client,
+};
+
+
 static ssize_t show_in(struct device *dev, struct device_attribute *attr,
char *buf)
 {
@@ -741,7 +750,7 @@ int it87_detect(struct i2c_adapter *adap
 
/* Reserve the ISA region */
if (is_isa)
-   if (!request_region(address, IT87_EXTENT, it87_driver.name))
+   if (!request_region(address, IT87_EXTENT, it87_isa_driver.name))
goto ERROR0;
 
/* Probe whether there is anything available on this address. Already
@@ -787,7 +796,7 @@ int it87_detect(struct i2c_adapter *adap
i2c_set_clientdata(new_client, data);
new_client-addr = address;
new_client-adapter = adapter;
-   new_client-driver = it87_driver;
+   new_client-driver = is_isa ? it87_isa_driver : it87_driver;
new_client-flags = 0;
 
/* Now, we do the remaining detection. */
@@ -1172,16 +1181,28 @@ static struct it87_data *it87_update_dev
 
 static int __init sm_it87_init(void)
 {
-   int addr;
+   int addr, res;
 
if (!it87_find(addr)) {
normal_isa[0] = addr;
}
-   return i2c_add_driver(it87_driver);
+
+   res = i2c_add_driver(it87_driver);
+   if (res)
+   return res;
+
+   res = i2c_isa_add_driver(it87_isa_driver);
+   if (res) {
+   i2c_del_driver(it87_driver);
+   return res;
+   }
+
+   return 0;
 }
 
 static void __exit sm_it87_exit(void)
 {
+   i2c_isa_del_driver(it87_isa_driver);
i2c_del_driver(it87_driver);
 }
 
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -23,6 +23,7 @@
 #include linux/slab.h
 #include linux/jiffies.h
 #include linux/i2c.h
+#include linux/i2c-isa.h
 #include linux/i2c-sensor.h
 #include linux/hwmon.h
 #include linux/err.h
@@ -177,6 +178,14 @@ static struct i2c_driver lm78_driver = {
.detach_client  = lm78_detach_client,
 };
 
+static struct i2c_driver lm78_isa_driver = {
+   .owner  = THIS_MODULE,
+   .name   = lm78-isa,
+   .attach_adapter = lm78_attach_adapter,
+   .detach_client  = lm78_detach_client,
+};
+
+
 /* 7 Voltages */
 static ssize_t show_in(struct device *dev, char *buf, int nr)
 {
@@ -488,7 +497,8 @@ int lm78_detect(struct i2c_adapter *adap
 
/* Reserve the ISA region */
if (is_isa)
-   if (!request_region(address, LM78_EXTENT, lm78_driver.name)) {
+   if (!request_region(address, LM78_EXTENT,
+   lm78_isa_driver.name)) {
err = -EBUSY;
goto ERROR0;
}
@@ -543,7 +553,7 @@ int lm78_detect(struct i2c_adapter *adap
i2c_set_clientdata(new_client, data);
new_client-addr = address;
new_client-adapter = adapter;
-   new_client-driver = lm78_driver;
+   new_client-driver = is_isa ? 

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (4/9)

2005-09-06 Thread Linux Kernel Mailing List
tree 5ae9c01c08497279fb3ffeac0394261412bdd6a9
parent fde0950903ce8cc38a91dd095280decceda2ff82
author Jean Delvare [EMAIL PROTECTED] Tue, 19 Jul 2005 23:53:07 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:10 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (4/9)

All ISA hardware monitoring drivers (including hybrid drivers) now have
a hard dependency on i2c-isa, so they must select I2C_ISA. As a result,
CONFIG_I2C_ISA doesn't need to be left visible to the user. The good
thing here is that users will stop complaining that some driver doesn't
work just because they forgot to compile or load i2c-isa.

At this point, all drivers are working again and the cleanup phase can
begin.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/Kconfig  |3 +++
 drivers/i2c/busses/Kconfig |8 +---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -160,6 +160,7 @@ config SENSORS_IT87
tristate ITE IT87xx and compatibles
depends on HWMON  I2C
select I2C_SENSOR
+   select I2C_ISA
help
  If you say yes here you get support for ITE IT87xx sensor chips
  and clones: SiS960.
@@ -211,6 +212,7 @@ config SENSORS_LM78
tristate National Semiconductor LM78 and compatibles
depends on HWMON  I2C  EXPERIMENTAL
select I2C_SENSOR
+   select I2C_ISA
help
  If you say yes here you get support for National Semiconductor LM78,
  LM78-J and LM79.
@@ -366,6 +368,7 @@ config SENSORS_W83781D
tristate Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F
depends on HWMON  I2C
select I2C_SENSOR
+   select I2C_ISA
help
  If you say yes here you get support for the Winbond W8378x series
  of sensor chips: the W83781D, W83782D, W83783S and W83627HF,
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -182,14 +182,8 @@ config I2C_IOP3XX
  will be called i2c-iop3xx.
 
 config I2C_ISA
-   tristate ISA Bus support
+   tristate
depends on I2C
-   help
- If you say yes to this option, support will be included for i2c
- interfaces that are on the ISA bus.
-
- This driver can also be built as a module.  If so, the module
- will be called i2c-isa.
 
 config I2C_ITE
tristate ITE I2C Adapter
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (6/9)

2005-09-06 Thread Linux Kernel Mailing List
tree 64a2d9b6502f861f97afc47637527367b08881ae
parent 2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0
author Jean Delvare [EMAIL PROTECTED] Tue, 19 Jul 2005 23:57:54 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:11 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (6/9)

Kill all isa-related stuff from i2c_detect, it's not used anymore.

This is one major step in the directiom of merging i2c_probe and
i2c_detect. The last obstacle I can think of is the different way forced
addresses work between sensors and non-sensors i2c drivers. I'll deal
with that in a later patchset.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/i2c-sensor-detect.c |   45 +++-
 1 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/drivers/i2c/i2c-sensor-detect.c b/drivers/i2c/i2c-sensor-detect.c
--- a/drivers/i2c/i2c-sensor-detect.c
+++ b/drivers/i2c/i2c-sensor-detect.c
@@ -25,42 +25,34 @@
 #include linux/i2c-sensor.h
 
 static unsigned short empty[] = {I2C_CLIENT_END};
-static unsigned int empty_isa[] = {I2C_CLIENT_ISA_END};
 
-/* Very inefficient for ISA detects, and won't work for 10-bit addresses! */
+/* Won't work for 10-bit addresses! */
 int i2c_detect(struct i2c_adapter *adapter,
   struct i2c_address_data *address_data,
   int (*found_proc) (struct i2c_adapter *, int, int))
 {
int addr, i, found, j, err;
struct i2c_force_data *this_force;
-   int is_isa = i2c_is_isa_adapter(adapter);
-   int adapter_id =
-   is_isa ? ANY_I2C_ISA_BUS : i2c_adapter_id(adapter);
+   int adapter_id = i2c_adapter_id(adapter);
unsigned short *normal_i2c;
-   unsigned int *normal_isa;
unsigned short *probe;
unsigned short *ignore;
 
/* Forget it if we can't probe using SMBUS_QUICK */
-   if ((!is_isa) 
-   !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK))
+   if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK))
return -1;

/* Use default empty list if the adapter doesn't specify any */
normal_i2c = probe = ignore = empty;
-   normal_isa = empty_isa;
if (address_data-normal_i2c)
normal_i2c = address_data-normal_i2c;
-   if (address_data-normal_isa)
-   normal_isa = address_data-normal_isa;
if (address_data-probe)
probe = address_data-probe;
if (address_data-ignore)
ignore = address_data-ignore;
 
-   for (addr = 0x00; addr = (is_isa ? 0x : 0x7f); addr++) {
-   if (!is_isa  i2c_check_addr(adapter, addr))
+   for (addr = 0x00; addr = 0x7f; addr++) {
+   if (i2c_check_addr(adapter, addr))
continue;
 
/* If it is in one of the force entries, we don't do any
@@ -69,7 +61,7 @@ int i2c_detect(struct i2c_adapter *adapt
for (i = 0; !found  (this_force = address_data-forces + i, 
this_force-force); i++) {
for (j = 0; !found  (this_force-force[j] != 
I2C_CLIENT_END); j += 2) {
if ( ((adapter_id == this_force-force[j]) ||
- ((this_force-force[j] == ANY_I2C_BUS)  
!is_isa)) 
+ (this_force-force[j] == ANY_I2C_BUS)) 
  (addr == this_force-force[j + 1]) ) {
dev_dbg(adapter-dev, found force 
parameter for adapter %d, addr %04x\n, adapter_id, addr);
if ((err = found_proc(adapter, addr, 
this_force-kind)))
@@ -85,8 +77,7 @@ int i2c_detect(struct i2c_adapter *adapt
   right now */
for (i = 0; !found  (ignore[i] != I2C_CLIENT_END); i += 2) {
if ( ((adapter_id == ignore[i]) ||
- ((ignore[i] == ANY_I2C_BUS) 
-  !is_isa)) 
+ (ignore[i] == ANY_I2C_BUS)) 
  (addr == ignore[i + 1])) {
dev_dbg(adapter-dev, found ignore parameter 
for adapter %d, addr %04x\n, adapter_id, addr);
found = 1;
@@ -97,19 +88,10 @@ int i2c_detect(struct i2c_adapter *adapt
 
/* Now, we will do a detection, but only if it is in the normal 
or 
   probe entries */
-   if (is_isa) {
-   for (i = 0; !found  (normal_isa[i] != 
I2C_CLIENT_ISA_END); i += 1) {
-   if (addr == normal_isa[i]) {
-   dev_dbg(adapter-dev, found normal 
isa entry for adapter %d, addr %04x\n, adapter_id, addr);
-   found = 1;
-   }
-   }
-   } else {
-   for (i = 0; !found  

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9)

2005-09-06 Thread Linux Kernel Mailing List
tree e23a3c7eba547c9d81c7680a40c41536c8a45da3
parent 4926c0d4de77c5396a274ee7941ed7fc02afed26
author Jean Delvare [EMAIL PROTECTED] Wed, 20 Jul 2005 00:02:32 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:12 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9)

Kill normal_isa in header files, documentation and all chip drivers, as
it is no more used.

normal_i2c could be renamed to normal, but I decided not to do so at the
moment, so as to limit the number of changes. This might be done later
as part of the i2c_probe/i2c_detect merge.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/porting-clients |7 ---
 Documentation/i2c/writing-clients |   35 +++
 drivers/hwmon/adm1021.c   |1 -
 drivers/hwmon/adm1025.c   |1 -
 drivers/hwmon/adm1026.c   |1 -
 drivers/hwmon/adm1031.c   |1 -
 drivers/hwmon/adm9240.c   |2 --
 drivers/hwmon/asb100.c|3 ---
 drivers/hwmon/atxp1.c |1 -
 drivers/hwmon/ds1621.c|1 -
 drivers/hwmon/fscher.c|1 -
 drivers/hwmon/fscpos.c|1 -
 drivers/hwmon/gl518sm.c   |1 -
 drivers/hwmon/gl520sm.c   |1 -
 drivers/hwmon/it87.c  |1 -
 drivers/hwmon/lm63.c  |1 -
 drivers/hwmon/lm75.c  |1 -
 drivers/hwmon/lm77.c  |1 -
 drivers/hwmon/lm78.c  |1 -
 drivers/hwmon/lm80.c  |1 -
 drivers/hwmon/lm83.c  |1 -
 drivers/hwmon/lm85.c  |1 -
 drivers/hwmon/lm87.c  |1 -
 drivers/hwmon/lm90.c  |1 -
 drivers/hwmon/lm92.c  |1 -
 drivers/hwmon/max1619.c   |1 -
 drivers/hwmon/w83781d.c   |1 -
 drivers/hwmon/w83l785ts.c |1 -
 drivers/i2c/chips/ds1337.c|1 -
 drivers/i2c/chips/eeprom.c|1 -
 drivers/i2c/chips/max6875.c   |1 -
 drivers/i2c/chips/pca9539.c   |1 -
 drivers/i2c/chips/pcf8574.c   |1 -
 drivers/i2c/chips/pcf8591.c   |1 -
 include/linux/i2c-sensor.h|   36 +++-
 include/linux/i2c.h   |8 ++--
 36 files changed, 36 insertions(+), 85 deletions(-)

diff --git a/Documentation/i2c/porting-clients 
b/Documentation/i2c/porting-clients
--- a/Documentation/i2c/porting-clients
+++ b/Documentation/i2c/porting-clients
@@ -29,8 +29,8 @@ Technical changes:
   Please respect this inclusion order. Some extra headers may be
   required for a given driver (e.g. lm75.h).
 
-* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, SENSORS_ISA_END
-  becomes I2C_CLIENT_ISA_END.
+* [Addresses] SENSORS_I2C_END becomes I2C_CLIENT_END, ISA addresses
+  are no more handled by the i2c core.
 
 * [Client data] Get rid of sysctl_id. Try using standard names for
   register values (for example, temp_os becomes temp_max). You're
@@ -72,7 +72,8 @@ Technical changes:
   name string, which will be filled with a lowercase, short string
   (typically the driver name, e.g. lm75).
   In i2c-only drivers, drop the i2c_is_isa_adapter check, it's
-  useless.
+  useless. Same for isa-only drivers, as the test would always be
+  true. Only hybrid drivers (which are quite rare) still need it.
   The errorN labels are reduced to the number needed. If that number
   is 2 (i2c-only drivers), it is advised that the labels are named
   exit and exit_free. For i2c+isa drivers, labels should be named
diff --git a/Documentation/i2c/writing-clients 
b/Documentation/i2c/writing-clients
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -195,31 +195,28 @@ Probing classes (sensors)
 -
 
 If you write a `sensors' driver, you use a slightly different interface.
-As well as I2C addresses, we have to cope with ISA addresses. Also, we
-use a enum of chip types. Don't forget to include `sensors.h'.
+Also, we use a enum of chip types. Don't forget to include `sensors.h'.
 
 The following lists are used internally. They are all lists of integers.
 
-   normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END.
+   normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END.
  A list of I2C addresses which should normally be examined.
-   normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.
- A list of ISA addresses which should normally be examined.
-   probe: insmod parameter. Initialize this list with SENSORS_I2C_END values.
- A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for
- the ISA bus, -1 for any I2C bus), the second is the address. These
- addresses are also probed, as if they were in the 'normal' list.
-   ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values.
- A list of pairs. The first value is a bus number 

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (8/9)

2005-09-06 Thread Linux Kernel Mailing List
tree 94e8c388df0de6561da7f10840f4e87dead18724
parent 5071860aba7fc69279ab822638ed2c2e4549f9fd
author Jean Delvare [EMAIL PROTECTED] Wed, 20 Jul 2005 00:05:33 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:12 -0700

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (8/9)

Kill all uses of i2c_is_isa_adapter except for the hybrid drivers (it87,
lm78, w83781d). The i2c-isa adapter not being registered with the i2c
core anymore, drivers don't have to fear being erroneously attached to
it.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/writing-clients |   11 +--
 drivers/hwmon/adm1021.c   |9 -
 drivers/hwmon/asb100.c|8 
 drivers/hwmon/lm75.c  |   10 --
 drivers/hwmon/lm85.c  |5 -
 5 files changed, 5 insertions(+), 38 deletions(-)

diff --git a/Documentation/i2c/writing-clients 
b/Documentation/i2c/writing-clients
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -315,11 +315,10 @@ For now, you can ignore the `flags' para
 const char *type_name = ;
 int is_isa = i2c_is_isa_adapter(adapter);
 
-if (is_isa) {
+/* Do this only if the chip can additionally be found on the ISA bus
+   (hybrid chip). */
 
-  /* If this client can't be on the ISA bus at all, we can stop now
- (call `goto ERROR0'). But for kicks, we will assume it is all
- right. */
+if (is_isa) {
 
   /* Discard immediately if this ISA range is already used */
   if (check_region(address,FOO_EXTENT))
@@ -495,10 +494,10 @@ much simpler than the attachment code, f
   return err;
 }
 
-/* SENSORS ONLY START */
+/* HYBRID SENSORS CHIP ONLY START */
 if i2c_is_isa_client(client)
   release_region(client-addr,LM78_EXTENT);
-/* SENSORS ONLY END */
+/* HYBRID SENSORS CHIP ONLY END */
 
 kfree(client); /* Frees client data too, if allocated at the same time */
 return 0;
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -198,15 +198,6 @@ static int adm1021_detect(struct i2c_ada
int err = 0;
const char *type_name = ;
 
-   /* Make sure we aren't probing the ISA bus!! This is just a safety check
-  at this moment; i2c_detect really won't call us. */
-#ifdef DEBUG
-   if (i2c_is_isa_adapter(adapter)) {
-   dev_dbg(adapter-dev, adm1021_detect called for an ISA bus 
adapter?!?\n);
-   return 0;
-   }
-#endif
-
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
goto error0;
 
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -714,14 +714,6 @@ static int asb100_detect(struct i2c_adap
struct i2c_client *new_client;
struct asb100_data *data;
 
-   /* asb100 is SMBus only */
-   if (i2c_is_isa_adapter(adapter)) {
-   pr_debug(asb100.o: detect failed, 
-   cannot attach to legacy adapter!\n);
-   err = -ENODEV;
-   goto ERROR0;
-   }
-
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
pr_debug(asb100.o: detect failed, 
smbus byte data not supported!\n);
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -121,16 +121,6 @@ static int lm75_detect(struct i2c_adapte
int err = 0;
const char *name = ;
 
-   /* Make sure we aren't probing the ISA bus!! This is just a safety check
-  at this moment; i2c_detect really won't call us. */
-#ifdef DEBUG
-   if (i2c_is_isa_adapter(adapter)) {
-   dev_dbg(adapter-dev,
-   lm75_detect called for an ISA bus adapter?!?\n);
-   goto exit;
-   }
-#endif
-
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
 I2C_FUNC_SMBUS_WORD_DATA))
goto exit;
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -1033,11 +1033,6 @@ int lm85_detect(struct i2c_adapter *adap
int err = 0;
const char *type_name = ;
 
-   if (i2c_is_isa_adapter(adapter)) {
-   /* This chip has no ISA interface */
-   goto ERROR0 ;
-   };
-
if (!i2c_check_functionality(adapter,
I2C_FUNC_SMBUS_BYTE_DATA)) {
/* We need to be able to do byte I/O */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: W83792D driver 1/3

2005-09-06 Thread Linux Kernel Mailing List
tree c04676ff2cd3730efeb1a5b3dda2d9df9b1c1279
parent 570aefc361d3315ec6749f573009286106b0b2d8
author [EMAIL PROTECTED] [EMAIL PROTECTED] Wed, 27 Jul 2005 11:43:47 +
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:13 -0700

[PATCH] I2C: W83792D driver 1/3

I would like to announce support for W83792D chip. This driver was developed
by Winbond Electronics Corp. I added sysfs attributes callbacks infrastructure
plus various code fixes and codingstyle cleanups. I would like to thank Winbond
for supporting free software.

This patch is against 2.6.13rc3 plus hwmon-class and hwmon-split.
Separate patch for documantation and hwmon class register will follow.

Signed-off-by: Rudolf Marek [EMAIL PROTECTED]
Signed-off-by: Chunhao Huang [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/Kconfig   |   10 
 drivers/hwmon/Makefile  |1 
 drivers/hwmon/w83792d.c | 1633 
 include/linux/hwmon-sysfs.h |   15 
 4 files changed, 1659 insertions(+)

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -377,6 +377,16 @@ config SENSORS_W83781D
  This driver can also be built as a module.  If so, the module
  will be called w83781d.
 
+config SENSORS_W83792D
+   tristate Winbond W83792D
+   depends on HWMON  I2C  EXPERIMENTAL
+   select I2C_SENSOR
+   help
+ If you say yes here you get support for the Winbond W83792D chip.
+
+ This driver can also be built as a module.  If so, the module
+ will be called w83792d.
+
 config SENSORS_W83L785TS
tristate Winbond W83L785TS-S
depends on HWMON  I2C  EXPERIMENTAL
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_HWMON) += hwmon.o
 # asb100, then w83781d go first, as they can override other drivers' addresses.
 obj-$(CONFIG_SENSORS_ASB100)   += asb100.o
 obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o
+obj-$(CONFIG_SENSORS_W83792D)  += w83792d.o
 obj-$(CONFIG_SENSORS_W83781D)  += w83781d.o
 
 obj-$(CONFIG_SENSORS_ADM1021)  += adm1021.o
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
new file mode 100644
--- /dev/null
+++ b/drivers/hwmon/w83792d.c
@@ -0,0 +1,1633 @@
+/*
+w83792d.c - Part of lm_sensors, Linux kernel modules for hardware
+monitoring
+Copyright (C) 2004, 2005 Winbond Electronics Corp.
+Chunhao Huang [EMAIL PROTECTED],
+Rudolf Marek [EMAIL PROTECTED]
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Note:
+1. This driver is only for 2.6 kernel, 2.4 kernel need a different driver.
+2. This driver is only for Winbond W83792D C version device, there
+   are also some motherboards with B version W83792D device. The
+   calculation method to in6-in7(measured value, limits) is a little
+   different between C and B version. C or B version can be identified
+   by CR[0x49h].
+*/
+
+/*
+Supports following chips:
+
+Chip   #vin#fanin  #pwm#temp   wchipid vendid  i2c ISA
+w83792d9   7   7   3   0x7a0x5ca3  yes no
+*/
+
+#include linux/config.h
+#include linux/module.h
+#include linux/init.h
+#include linux/slab.h
+#include linux/i2c.h
+#include linux/i2c-sensor.h
+#include linux/i2c-vid.h
+#include linux/hwmon-sysfs.h
+
+/* Addresses to scan */
+static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END 
};
+
+/* Insmod parameters */
+SENSORS_INSMOD_1(w83792d);
+I2C_CLIENT_MODULE_PARM(force_subclients, List of subclient addresses: 
+   {bus, clientaddr, subclientaddr1, subclientaddr2});
+
+static int init;
+module_param(init, bool, 0);
+MODULE_PARM_DESC(init, Set to one to force chip initialization);
+
+/* The W83792D registers */
+static const u8 W83792D_REG_IN[9] = {
+   0x20,   /* Vcore A in DataSheet */
+   0x21,   /* Vcore B in DataSheet */
+   0x22,   /* VIN0 in DataSheet */
+   0x23,   /* VIN1 in DataSheet */
+   0x24,   /* VIN2 in DataSheet */
+   0x25,   /* VIN3 in DataSheet */
+   0x26,   /* 5VCC in DataSheet */
+   0xB0,   

[PATCH] I2C: W83792D documentation 3/3

2005-09-06 Thread Linux Kernel Mailing List
tree 3e5974c1f611cd995717169a9caacb1a2f431561
parent ce785ab460ce8728a9daf337ba8fab3ba692b6aa
author [EMAIL PROTECTED] [EMAIL PROTECTED] Wed, 27 Jul 2005 09:25:28 +
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:14 -0700

[PATCH] I2C: W83792D documentation 3/3

This patch adds documentation entry for W83792D chip.

Signed-off-by: Rudolf Marek [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/hwmon/w83792d |  174 
 1 files changed, 174 insertions(+)

diff --git a/Documentation/hwmon/w83792d b/Documentation/hwmon/w83792d
new file mode 100644
--- /dev/null
+++ b/Documentation/hwmon/w83792d
@@ -0,0 +1,174 @@
+Kernel driver w83792d
+=
+
+Supported chips:
+  * Winbond W83792D
+Prefix: 'w83792d'
+Addresses scanned: I2C 0x2c - 0x2f
+Datasheet: 
http://www.winbond.com.tw/E-WINBONDHTM/partner/PDFresult.asp?Pname=1035
+
+Author: Chunhao Huang
+Contact: DZShen [EMAIL PROTECTED]
+
+
+Module Parameters
+-
+
+* init int
+  (default 1)
+  Use 'init=0' to bypass initializing the chip.
+  Try this if your computer crashes when you load the module.
+
+* force_subclients=bus,caddr,saddr,saddr
+  This is used to force the i2c addresses for subclients of
+  a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b'
+  to force the subclients of chip 0x2f on bus 0 to i2c addresses
+  0x4a and 0x4b.
+
+
+Description
+---
+
+This driver implements support for the Winbond W83792AD/D.
+
+Detection of the chip can sometimes be foiled because it can be in an
+internal state that allows no clean access (Bank with ID register is not
+currently selected). If you know the address of the chip, use a 'force'
+parameter; this will put it into a more well-behaved state first.
+
+The driver implements three temperature sensors, seven fan rotation speed
+sensors, nine voltage sensors, and two automatic fan regulation
+strategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II.
+Automatic fan control mode is possible only for fan1-fan3. Fan4-fan7 can run
+synchronized with selected fan (fan1-fan3). This functionality and manual PWM
+control for fan4-fan7 is not yet implemented.
+
+Temperatures are measured in degrees Celsius and measurement resolution is 1
+degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
+the temperature gets higher than the Overtemperature Shutdown value; it stays
+on until the temperature falls below the Hysteresis value.
+
+Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
+triggered if the rotation speed has dropped below a programmable limit. Fan
+readings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or
+128) to give the readings more range or accuracy.
+
+Voltage sensors (also known as IN sensors) report their values in millivolts.
+An alarm is triggered if the voltage has crossed a programmable minimum
+or maximum limit.
+
+Alarms are provided as output from realtime status register. Following bits
+are defined:
+
+bit - alarm on:
+0  - in0
+1  - in1
+2  - temp1
+3  - temp2
+4  - temp3
+5  - fan1
+6  - fan2
+7  - fan3
+8  - in2
+9  - in3
+10 - in4
+11 - in5
+12 - in6
+13 - VID change
+14 - chassis
+15 - fan7
+16 - tart1
+17 - tart2
+18 - tart3
+19 - in7
+20 - in8
+21 - fan4
+22 - fan5
+23 - fan6
+
+Tart will be asserted while target temperature cannot be achieved after 3 
minutes
+of full speed rotation of corresponding fan.
+
+In addition to the alarms described above, there is a CHAS alarm on the chips
+which triggers if your computer case is open (This one is latched, contrary
+to realtime alarms).
+
+The chips only update values each 3 seconds; reading them more often will
+do no harm, but will return 'old' values.
+
+
+W83792D PROBLEMS
+
+Known problems:
+   - This driver is only for Winbond W83792D C version device, there
+ are also some motherboards with B version W83792D device. The
+ calculation method to in6-in7(measured value, limits) is a little
+ different between C and B version. C or B version can be identified
+ by CR[0x49h].
+   - The function of vid and vrm has not been finished, because I'm NOT
+ very familiar with them. Adding support is welcome.
+�  - The function of chassis open detection needs more tests.
+   - If you have ASUS server board and chip was not found: Then you will
+ need to upgrade to latest (or beta) BIOS. If it does not help please
+ contact us.
+
+Fan control
+---
+
+Manual mode
+---
+
+Works as expected. You just need to specify desired PWM/DC value (fan speed)
+in appropriate pwm# file.
+
+Thermal cruise
+--
+
+In this mode, W83792D provides the Smart Fan system to automatically control
+fan speed to keep the temperatures of CPU and the system within specific
+range. At first a wanted temperature and interval 

[PATCH] I2C: refactor message in i2c_detach_client

2005-09-06 Thread Linux Kernel Mailing List
tree 6c342574710f730d39bf5383f81eaa9f9bb10a25
parent 1ff4e3065b41847b6fe5908b1214cb508dd49e61
author Jean Delvare [EMAIL PROTECTED] Wed, 27 Jul 2005 22:14:49 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:14 -0700

[PATCH] I2C: refactor message in i2c_detach_client

We could refactor the error message 34 different i2c drivers print if
i2c_detach_client() fails in this function itself. Saves quite a few
lines of code. Documentation is updated to reflect that change.

Note that this patch should be applied after Rudolf Marek's w83792d
patches.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/porting-clients |3 ++-
 Documentation/i2c/writing-clients |4 +---
 drivers/hwmon/adm1021.c   |4 +---
 drivers/hwmon/adm1025.c   |5 +
 drivers/hwmon/adm9240.c   |5 +
 drivers/hwmon/asb100.c|5 +
 drivers/hwmon/ds1621.c|5 +
 drivers/hwmon/fscher.c|5 +
 drivers/hwmon/fscpos.c|5 +
 drivers/hwmon/gl518sm.c   |5 +
 drivers/hwmon/gl520sm.c   |5 +
 drivers/hwmon/it87.c  |5 +
 drivers/hwmon/lm63.c  |5 +
 drivers/hwmon/lm78.c  |5 +
 drivers/hwmon/lm80.c  |5 +
 drivers/hwmon/lm83.c  |5 +
 drivers/hwmon/lm87.c  |5 +
 drivers/hwmon/lm90.c  |5 +
 drivers/hwmon/lm92.c  |5 +
 drivers/hwmon/max1619.c   |5 +
 drivers/hwmon/pc87360.c   |5 +
 drivers/hwmon/sis5595.c   |5 +
 drivers/hwmon/smsc47b397.c|5 +
 drivers/hwmon/smsc47m1.c  |5 +
 drivers/hwmon/via686a.c   |5 +
 drivers/hwmon/w83627ehf.c |5 +
 drivers/hwmon/w83627hf.c  |5 +
 drivers/hwmon/w83781d.c   |5 +
 drivers/hwmon/w83792d.c   |5 +
 drivers/hwmon/w83l785ts.c |5 +
 drivers/i2c/chips/ds1337.c|5 +
 drivers/i2c/chips/eeprom.c|4 +---
 drivers/i2c/chips/max6875.c   |4 +---
 drivers/i2c/chips/pca9539.c   |4 +---
 drivers/i2c/chips/pcf8574.c   |5 +
 drivers/i2c/chips/pcf8591.c   |5 +
 drivers/i2c/i2c-core.c|6 +-
 37 files changed, 42 insertions(+), 137 deletions(-)

diff --git a/Documentation/i2c/porting-clients 
b/Documentation/i2c/porting-clients
--- a/Documentation/i2c/porting-clients
+++ b/Documentation/i2c/porting-clients
@@ -94,7 +94,8 @@ Technical changes:
   limited to the strictly necessary steps.
 
 * [Detach] Get rid of data, remove the call to
-  i2c_deregister_entry.
+  i2c_deregister_entry. Do not log an error message if
+  i2c_detach_client fails, as i2c-core will now do it for you.
 
 * [Update] Don't access client-data directly, use
   i2c_get_clientdata(client) instead.
diff --git a/Documentation/i2c/writing-clients 
b/Documentation/i2c/writing-clients
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -489,10 +489,8 @@ much simpler than the attachment code, f
 /* SENSORS ONLY END */
 
 /* Try to detach the client from i2c space */
-if ((err = i2c_detach_client(client))) {
-  printk(foo.o: Client deregistration failed, client not detached.\n);
+if ((err = i2c_detach_client(client)))
   return err;
-}
 
 /* HYBRID SENSORS CHIP ONLY START */
 if i2c_is_isa_client(client)
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -328,10 +328,8 @@ static int adm1021_detach_client(struct 
 
hwmon_device_unregister(data-class_dev);
 
-   if ((err = i2c_detach_client(client))) {
-   dev_err(client-dev, Client deregistration failed, client not 
detached.\n);
+   if ((err = i2c_detach_client(client)))
return err;
-   }
 
kfree(data);
return 0;
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -517,11 +517,8 @@ static int adm1025_detach_client(struct 
 
hwmon_device_unregister(data-class_dev);
 
-   if ((err = i2c_detach_client(client))) {
-   dev_err(client-dev, Client deregistration failed, 
-   client not detached.\n);
+   if ((err = i2c_detach_client(client)))
return err;
-   }
 
kfree(data);
return 0;
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -645,11 +645,8 @@ static int adm9240_detach_client(struct 
 
hwmon_device_unregister(data-class_dev);
 
-   if ((err = i2c_detach_client(client))) {
-   dev_err(client-dev, Client deregistration failed, 

[PATCH] hwmon: tag super-i/o find functions __init

2005-09-06 Thread Linux Kernel Mailing List
tree 13f6390bd5a31db45012ff93d9b93968256a7ab7
parent 7bef559455fc71f66f8573cc1aafe1dd33966c1c
author Jean Delvare [EMAIL PROTECTED] Wed, 27 Jul 2005 21:32:02 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:15 -0700

[PATCH] hwmon: tag super-i/o find functions __init

Super-I/O find functions in hardware monitoring drivers can be tagged
__init as they are only called from functions themselves tagged __init.
Two of them (smsc47b397 and w83627ehf) already do, but the other four
of them (it87, pc87360, smsc47m1 and w83627hf) did not.

This saves a few bytes of memory after the drivers are loaded, 192 in
the case of the it87 driver.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/it87.c |2 +-
 drivers/hwmon/pc87360.c  |2 +-
 drivers/hwmon/smsc47m1.c |2 +-
 drivers/hwmon/w83627hf.c |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -707,7 +707,7 @@ static int it87_isa_attach_adapter(struc
 }
 
 /* SuperIO detection - will change isa_address if a chip is found */
-static int it87_find(int *address)
+static int __init it87_find(int *address)
 {
int err = -ENODEV;
 
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -626,7 +626,7 @@ static DEVICE_ATTR(alarms_temp, S_IRUGO,
  * Device detection, registration and update
  */
 
-static int pc87360_find(int sioaddr, u8 *devid, unsigned short *addresses)
+static int __init pc87360_find(int sioaddr, u8 *devid, unsigned short 
*addresses)
 {
u16 val;
int i;
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -345,7 +345,7 @@ fan_present(2);
 
 static DEVICE_ATTR(alarms, S_IRUGO, get_alarms, NULL);
 
-static int smsc47m1_find(unsigned short *addr)
+static int __init smsc47m1_find(unsigned short *addr)
 {
u8 val;
 
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -958,7 +958,7 @@ device_create_file(client-dev, dev_at
 } while (0)
 
 
-static int w83627hf_find(int sioaddr, unsigned short *addr)
+static int __init w83627hf_find(int sioaddr, unsigned short *addr)
 {
u16 val;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: inline i2c_adapter_id

2005-09-06 Thread Linux Kernel Mailing List
tree 35569bf55128dbbeac19fc05db8ce2bb940fdb18
parent e6cfb3ad7209e4f4dcdc14f5fc437db55667041f
author Jean Delvare [EMAIL PROTECTED] Thu, 28 Jul 2005 23:09:40 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:15 -0700

[PATCH] I2C: inline i2c_adapter_id

We could inline i2c_adapter_id, as it is really, really short. Doing
so saves a few bytes both in i2c-core and in the drivers using this
function.

before after  diff
drivers/hwmon/adm1026.ko 41344 41305   -39
drivers/hwmon/asb100.ko  27325 27246   -79
drivers/hwmon/gl518sm.ko 20824 20785   -39
drivers/hwmon/it87.ko26419 26380   -39
drivers/hwmon/lm78.ko21424 21385   -39
drivers/hwmon/lm85.ko41034 40939   -95
drivers/hwmon/w83781d.ko 39561 39514   -47
drivers/hwmon/w83792d.ko 32979 32932   -47
drivers/i2c/i2c-core.ko  24708 24531  -177

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/i2c-core.c |9 -
 include/linux/i2c.h|   10 ++
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -759,14 +759,6 @@ int i2c_probe(struct i2c_adapter *adapte
return 0;
 }
 
-/*
- * return id number for a specific adapter
- */
-int i2c_adapter_id(struct i2c_adapter *adap)
-{
-   return adap-nr;
-}
-
 struct i2c_adapter* i2c_get_adapter(int id)
 {
struct i2c_adapter *adapter;
@@ -1196,7 +1188,6 @@ EXPORT_SYMBOL(i2c_master_send);
 EXPORT_SYMBOL(i2c_master_recv);
 EXPORT_SYMBOL(i2c_control);
 EXPORT_SYMBOL(i2c_transfer);
-EXPORT_SYMBOL(i2c_adapter_id);
 EXPORT_SYMBOL(i2c_get_adapter);
 EXPORT_SYMBOL(i2c_put_adapter);
 EXPORT_SYMBOL(i2c_probe);
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -364,10 +364,6 @@ extern int i2c_probe(struct i2c_adapter 
  */
 extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
 
-/* This call returns a unique low identifier for each registered adapter,
- * or -1 if the adapter was not registered. 
- */
-extern int i2c_adapter_id(struct i2c_adapter *adap);
 extern struct i2c_adapter* i2c_get_adapter(int id);
 extern void i2c_put_adapter(struct i2c_adapter *adap);
 
@@ -384,6 +380,12 @@ static inline int i2c_check_functionalit
return (func  i2c_get_functionality(adap)) == func;
 }
 
+/* Return id number for a specific adapter */
+static inline int i2c_adapter_id(struct i2c_adapter *adap)
+{
+   return adap-nr;
+}
+
 /*
  * I2C Message - used for pure i2c transaction, also from /dev interface
  */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: i2c-algo-pca -- gracefully handle a busy bus

2005-09-06 Thread Linux Kernel Mailing List
tree 8897c3568fc5f6651fa0ddb80d7e60a8ca2adef4
parent cdcb19219714c796ddef1202e952566c5f86354d
author Ian Campbell [EMAIL PROTECTED] Wed, 10 Aug 2005 08:51:16 +0100
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:15 -0700

[PATCH] I2C: i2c-algo-pca -- gracefully handle a busy bus

I've been running with this patch for a while now, and while I've never
seen it trigger except with buggy hardware I think it is a cleaner way
to handle a busy bus. I had -EBUSY until about 10 minutes ago but -EIO
seems to be what most of the existing algo drivers will return in the
same circumstances.

Signed-off-by: Ian Campbell [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/algos/i2c-algo-pca.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -187,12 +187,14 @@ static int pca_xfer(struct i2c_adapter *
int numbytes = 0;
int state;
int ret;
+   int timeout = 100;
 
-   state = pca_status(adap);
-   if ( state != 0xF8 ) {
-   dev_dbg(i2c_adap-dev, bus is not idle. status is %#04x\n, 
state );
-   /* FIXME: what to do. Force stop ? */
-   return -EREMOTEIO;
+   while ((state = pca_status(adap)) != 0xf8  timeout--) {
+   msleep(10);
+   }
+   if (state != 0xf8) {
+   dev_dbg(i2c_adap-dev, bus is not idle. status is %#04x\n, 
state);
+   return -EIO;
}
 
DEB1({{{ XFER %d messages\n, num);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: lm85: trivial cleanups

2005-09-06 Thread Linux Kernel Mailing List
tree f543daa9379e4ddfbf1de92283680d3c49ee69e5
parent 53ae11b08353268c4012ef107bf205a0724d71aa
author Jean Delvare [EMAIL PROTECTED] Fri, 29 Jul 2005 20:51:54 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:17 -0700

[PATCH] hwmon: lm85: trivial cleanups

Remove an unused macro and an outdated comment from the lm85 driver.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/lm85.c |9 -
 1 files changed, 9 deletions(-)

diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -282,15 +282,6 @@ static int ZONE_TO_REG( int zone )
 #define PPR_TO_REG(val,fan) (SENSORS_LIMIT((val)-1,0,3)(fan *2))
 #define PPR_FROM_REG(val,fan) val)(fan * 2))0x03)+1)
 
-/* i2c-vid.h defines vid_from_reg() */
-#define VID_FROM_REG(val,vrm) (vid_from_reg((val),(vrm)))
-
-/* Unlike some other drivers we DO NOT set initial limits.  Use
- * the config file to set limits.  Some users have reported
- * motherboards shutting down when we set limits in a previous
- * version of the driver.
- */
-
 /* Chip sampling rates
  *
  * Some sensors are not updated more frequently than once per second
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: hwmon vs i2c, second round (02/11)

2005-09-06 Thread Linux Kernel Mailing List
tree ca83d278af5da3dfc9ef01f1d5bf479e67229d25
parent 9fc6adfa9adf2be84119a3c2592287f33bd1dff2
author Jean Delvare [EMAIL PROTECTED] Sun, 31 Jul 2005 21:33:23 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:18 -0700

[PATCH] hwmon: hwmon vs i2c, second round (02/11)

The way i2c-sensor handles forced addresses could be optimized. It
defines a structure (i2c_force_data) to associate a module parameter
with a given kind value, but in fact this kind value is always the
index of the structure in each array it is used in. So this additional
value can be omitted, and still be deduced in the code handling these
arrays.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/i2c-sensor-detect.c |   13 +--
 include/linux/i2c-sensor.h  |  133 ++--
 2 files changed, 67 insertions(+), 79 deletions(-)

diff --git a/drivers/i2c/i2c-sensor-detect.c b/drivers/i2c/i2c-sensor-detect.c
--- a/drivers/i2c/i2c-sensor-detect.c
+++ b/drivers/i2c/i2c-sensor-detect.c
@@ -32,7 +32,6 @@ int i2c_detect(struct i2c_adapter *adapt
   int (*found_proc) (struct i2c_adapter *, int, int))
 {
int addr, i, found, j, err;
-   struct i2c_force_data *this_force;
int adapter_id = i2c_adapter_id(adapter);
unsigned short *normal_i2c;
unsigned short *probe;
@@ -58,13 +57,13 @@ int i2c_detect(struct i2c_adapter *adapt
/* If it is in one of the force entries, we don't do any
   detection at all */
found = 0;
-   for (i = 0; !found  (this_force = address_data-forces + i, 
this_force-force); i++) {
-   for (j = 0; !found  (this_force-force[j] != 
I2C_CLIENT_END); j += 2) {
-   if ( ((adapter_id == this_force-force[j]) ||
- (this_force-force[j] == ANY_I2C_BUS)) 
- (addr == this_force-force[j + 1]) ) {
+   for (i = 0; address_data-forces[i]; i++) {
+   for (j = 0; !found  (address_data-forces[i][j] != 
I2C_CLIENT_END); j += 2) {
+   if ( ((adapter_id == 
address_data-forces[i][j]) ||
+ (address_data-forces[i][j] == 
ANY_I2C_BUS)) 
+ (addr == address_data-forces[i][j + 1]) 
) {
dev_dbg(adapter-dev, found force 
parameter for adapter %d, addr %04x\n, adapter_id, addr);
-   if ((err = found_proc(adapter, addr, 
this_force-kind)))
+   if ((err = found_proc(adapter, addr, 
i)))
return err;
found = 1;
}
diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h
--- a/include/linux/i2c-sensor.h
+++ b/include/linux/i2c-sensor.h
@@ -22,22 +22,6 @@
 #ifndef _LINUX_I2C_SENSOR_H
 #define _LINUX_I2C_SENSOR_H
 
-/* A structure containing detect information.
-   Force variables overrule all other variables; they force a detection on
-   that place. If a specific chip is given, the module blindly assumes this
-   chip type is present; if a general force (kind == 0) is given, the module
-   will still try to figure out what type of chip is present. This is useful
-   if for some reasons the detect for SMBus address space filled fails.
-   probe: insmod parameter. Initialize this list with I2C_CLIENT_END values.
- A list of pairs. The first value is a bus number (ANY_I2C_BUS for any
- I2C bus), the second is the address.
-   kind: The kind of chip. 0 equals any chip.
-*/
-struct i2c_force_data {
-   unsigned short *force;
-   unsigned short kind;
-};
-
 /* A structure containing the detect information.
normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END.
  A list of I2C addresses which should normally be examined.
@@ -50,14 +34,18 @@ struct i2c_force_data {
  I2C bus), the second is the I2C address. These addresses are never
  probed. This parameter overrules 'normal' and  probe', but not the
 'force' lists.
-   force_data: insmod parameters. A list, ending with an element of which
- the force field is NULL.
+   forces: insmod parameters. A list, ending with a NULL element.
+ Force variables overrule all other variables; they force a detection on
+ that place. If a specific chip is given, the module blindly assumes this
+ chip type is present; if a general force (kind == 0) is given, the module
+ will still try to figure out what type of chip is present. This is useful
+ if for some reasons the detect for SMBus address space filled fails.
 */
 struct i2c_address_data {
unsigned short *normal_i2c;
unsigned short *probe;
unsigned short *ignore;
-   struct 

[PATCH] hwmon: hwmon vs i2c, second round (08/11)

2005-09-06 Thread Linux Kernel Mailing List
tree d4c40ea5d37cffc2316c0528a8d9807fe114abde
parent 303760b44a7a142cb9f4c9df4609fb63bbda98db
author Jean Delvare [EMAIL PROTECTED] Sun, 31 Jul 2005 21:54:28 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:22 -0700

[PATCH] hwmon: hwmon vs i2c, second round (08/11)

Cleanup hwmon-vid a bit, fixing typos, rewording some comments and
reindenting properly at places.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/hwmon-vid.c |   21 +++--
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -38,14 +38,14 @@ static struct vrm_model vrm_models[] = {
{X86_VENDOR_AMD, 0x6, ANY, 90}, /* Athlon Duron etc */
{X86_VENDOR_AMD, 0xF, ANY, 24}, /* Athlon 64, Opteron */
{X86_VENDOR_INTEL, 0x6, 0x9, 85},   /* 0.13um too */
-   {X86_VENDOR_INTEL, 0x6, 0xB, 85},   /* 0xB Tualatin */
+   {X86_VENDOR_INTEL, 0x6, 0xB, 85},   /* Tualatin */
{X86_VENDOR_INTEL, 0x6, ANY, 82},   /* any P6 */
{X86_VENDOR_INTEL, 0x7, ANY, 0},/* Itanium */
{X86_VENDOR_INTEL, 0xF, 0x3, 100},  /* P4 Prescott */
{X86_VENDOR_INTEL, 0xF, ANY, 90},   /* P4 before Prescott */
{X86_VENDOR_INTEL, 0x10,ANY, 0},/* Itanium 2 */
{X86_VENDOR_UNKNOWN, ANY, ANY, 0}   /* stop here */
-   };
+};
 
 static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor)
 {
@@ -53,9 +53,9 @@ static int find_vrm(u8 eff_family, u8 ef
 
while (vrm_models[i].vendor!=X86_VENDOR_UNKNOWN) {
if (vrm_models[i].vendor==vendor)
-   if ((vrm_models[i].eff_family==eff_family) \
-   ((vrm_models[i].eff_model==eff_model)|| \
-   (vrm_models[i].eff_model==ANY)))
+   if ((vrm_models[i].eff_family==eff_family)
+ ((vrm_models[i].eff_model==eff_model) ||
+(vrm_models[i].eff_model==ANY)))
return vrm_models[i].vrm_type;
i++;
}
@@ -70,8 +70,9 @@ int vid_which_vrm(void)
u8 eff_family, eff_model;
int vrm_ret;
 
-   if (c-x86  6) return 0;   /* any CPU with familly lower than 6
-   dont have VID and/or CPUID */
+   if (c-x86  6) /* Any CPU with family lower than 6 */
+   return 0;   /* doesn't have VID and/or CPUID */
+
eax = cpuid_eax(1);
eff_family = ((eax  0x0F00)8);
eff_model  = ((eax  0x00F0)4);
@@ -81,12 +82,12 @@ int vid_which_vrm(void)
}
vrm_ret = find_vrm(eff_family,eff_model,c-x86_vendor);
if (vrm_ret == 0)
-   printk(KERN_INFO hwmon-vid: Unknown VRM version of your
-x86 CPU\n);
+   printk(KERN_INFO hwmon-vid: Unknown VRM version of your 
+  x86 CPU\n);
return vrm_ret;
 }
 
-/* and now for something completely different for Non-x86 world*/
+/* and now something completely different for the non-x86 world */
 #else
 int vid_which_vrm(void)
 {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: hwmon vs i2c, second round (10/11)

2005-09-06 Thread Linux Kernel Mailing List
tree a0305b5bcb691fa7bc7005b56b4dc45263fb3cbb
parent ee70d3a33368038d41985474d9e70ac07f19651c
author Jean Delvare [EMAIL PROTECTED] Mon, 01 Aug 2005 22:50:08 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:23 -0700

[PATCH] hwmon: hwmon vs i2c, second round (10/11)

I see very little reason why vid_from_reg is inlined. It is not
exactly short, its parameters are seldom known in advance, and it is
never called in speed critical areas. Uninlining it should cause
little performance loss if any, and saves a signficant space as well
as compilation time.

As suggested by Alexey Dobriyan, I am leaving vid_to_reg inline for now,
as it is short and has a single user so far.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/hwmon-vid.c |   82 +
 include/linux/hwmon-vid.h |   83 --
 2 files changed, 91 insertions(+), 74 deletions(-)

diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -3,6 +3,10 @@
 
 Copyright (c) 2004 Rudolf Marek [EMAIL PROTECTED]
 
+Partly imported from i2c-vid.h of the lm_sensors project
+Copyright (c) 2002 Mark D. Studebaker [EMAIL PROTECTED]
+With assistance from Trent Piepho [EMAIL PROTECTED]
+
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -23,6 +27,83 @@
 #include linux/kernel.h
 #include linux/hwmon-vid.h
 
+/*
+Common code for decoding VID pins.
+
+References:
+
+For VRM 8.4 to 9.1, VRM x.y DC-DC Converter Design Guidelines,
+available at http://developer.intel.com/.
+
+For VRD 10.0 and up, VRD x.y Design Guide,
+available at http://developer.intel.com/.
+
+AMD Opteron processors don't follow the Intel specifications.
+I'm going to make up 2.4 as the spec number for the Opterons.
+No good reason just a mnemonic for the 24x Opteron processor
+series.
+
+Opteron VID encoding is:
+   0  =  1.550 V
+   1  =  1.525 V
+. . . .
+   0  =  0.800 V
+   1  =  0.000 V (off)
+*/
+
+/* vrm is the VRM/VRD document version multiplied by 10.
+   val is the 4-, 5- or 6-bit VID code.
+   Returned value is in mV to avoid floating point in the kernel. */
+int vid_from_reg(int val, int vrm)
+{
+   int vid;
+
+   switch(vrm) {
+
+   case  0:
+   return 0;
+
+   case 100:   /* VRD 10.0 */
+   if((val  0x1f) == 0x1f)
+   return 0;
+   if((val  0x1f) = 0x09 || val == 0x0a)
+   vid = 10875 - (val  0x1f) * 250;
+   else
+   vid = 18625 - (val  0x1f) * 250;
+   if(val  0x20)
+   vid -= 125;
+   vid /= 10;  /* only return 3 dec. places for now */
+   return vid;
+
+   case 24:/* Opteron processor */
+   return(val == 0x1f ? 0 : 1550 - val * 25);
+
+   case 91:/* VRM 9.1 */
+   case 90:/* VRM 9.0 */
+   return(val == 0x1f ? 0 :
+  1850 - val * 25);
+
+   case 85:/* VRM 8.5 */
+   return((val  0x10  ? 25 : 0) +
+  ((val  0x0f)  0x04 ? 2050 : 1250) -
+  ((val  0x0f) * 50));
+
+   case 84:/* VRM 8.4 */
+   val = 0x0f;
+   /* fall through */
+   default:/* VRM 8.2 */
+   return(val == 0x1f ? 0 :
+  val  0x10  ? 5100 - (val) * 100 :
+2050 - (val) * 50);
+   }
+}
+
+
+/*
+After this point is the code to automatically determine which
+VRM/VRD specification should be used depending on the CPU.
+*/
+
 struct vrm_model {
u8 vendor;
u8 eff_family;
@@ -96,6 +177,7 @@ int vid_which_vrm(void)
 }
 #endif
 
+EXPORT_SYMBOL(vid_from_reg);
 EXPORT_SYMBOL(vid_which_vrm);
 
 MODULE_AUTHOR(Rudolf Marek [EMAIL PROTECTED]);
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h
--- a/include/linux/hwmon-vid.h
+++ b/include/linux/hwmon-vid.h
@@ -20,83 +20,16 @@
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-/*
-This file contains common code for decoding VID pins.
-This file is #included in various chip drivers in this directory.
-As the user is unlikely to load more than one driver which
-includes this code we don't worry about the wasted space.
-Reference: VRM x.y DC-DC Converter Design Guidelines,
-available at http://developer.intel.com
-*/
-
-/*
-AMD Opteron processors don't follow the Intel VRM 

[PATCH] hwmon: hwmon vs i2c, second round (11/11)

2005-09-06 Thread Linux Kernel Mailing List
tree d552112cd0721467e6ff0a13f8eef7c3491c847c
parent d0f282706df877f8fd8869419e308d24eedb523b
author Jean Delvare [EMAIL PROTECTED] Sun, 31 Jul 2005 22:12:09 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:24 -0700

[PATCH] hwmon: hwmon vs i2c, second round (11/11)

Use the common vid_from_reg function in lm78 rather than
reimplementing it.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/Kconfig |1 +
 drivers/hwmon/lm78.c  |   10 ++
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -207,6 +207,7 @@ config SENSORS_LM78
tristate National Semiconductor LM78 and compatibles
depends on HWMON  I2C  EXPERIMENTAL
select I2C_ISA
+   select HWMON_VID
help
  If you say yes here you get support for National Semiconductor LM78,
  LM78-J and LM79.
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -25,6 +25,7 @@
 #include linux/i2c.h
 #include linux/i2c-isa.h
 #include linux/hwmon.h
+#include linux/hwmon-vid.h
 #include linux/err.h
 #include asm/io.h
 
@@ -106,13 +107,6 @@ static inline int TEMP_FROM_REG(s8 val)
return val * 1000;
 }
 
-/* VID: mV
-   REG: (see doc/vid) */
-static inline int VID_FROM_REG(u8 val)
-{
-   return val==0x1f ? 0 : val=0x10 ? 5100-val*100 : 2050-val*50;
-}
-
 #define DIV_FROM_REG(val) (1  (val))
 
 /* There are some complications in a module like this. First off, LM78 chips
@@ -457,7 +451,7 @@ static DEVICE_ATTR(fan3_div, S_IRUGO, sh
 static ssize_t show_vid(struct device *dev, struct device_attribute *attr, 
char *buf)
 {
struct lm78_data *data = lm78_update_device(dev);
-   return sprintf(buf, %d\n, VID_FROM_REG(data-vid));
+   return sprintf(buf, %d\n, vid_from_reg(82, data-vid));
 }
 static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: VID table update

2005-09-06 Thread Linux Kernel Mailing List
tree 55c4697ce3835e35148d18572ceb7a30253b315e
parent 19f673eddb5a406be72989fb57b7f286772b8cf4
author [EMAIL PROTECTED] [EMAIL PROTECTED] Fri, 05 Aug 2005 15:40:11 +
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:24 -0700

[PATCH] hwmon: VID table update

This patch updates the VID entries, so any future
Intel CPU will be detected as unknown rather than 9.0

Signed-off-by: Rudolf Marek [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/hwmon-vid.c |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -122,8 +122,11 @@ static struct vrm_model vrm_models[] = {
{X86_VENDOR_INTEL, 0x6, 0xB, 85},   /* Tualatin */
{X86_VENDOR_INTEL, 0x6, ANY, 82},   /* any P6 */
{X86_VENDOR_INTEL, 0x7, ANY, 0},/* Itanium */
+   {X86_VENDOR_INTEL, 0xF, 0x0, 90},   /* P4 */
+   {X86_VENDOR_INTEL, 0xF, 0x1, 90},   /* P4 Willamette */
+   {X86_VENDOR_INTEL, 0xF, 0x2, 90},   /* P4 Northwood */
{X86_VENDOR_INTEL, 0xF, 0x3, 100},  /* P4 Prescott */
-   {X86_VENDOR_INTEL, 0xF, ANY, 90},   /* P4 before Prescott */
+   {X86_VENDOR_INTEL, 0xF, 0x4, 100},  /* P4 Prescott */
{X86_VENDOR_INTEL, 0x10,ANY, 0},/* Itanium 2 */
{X86_VENDOR_UNKNOWN, ANY, ANY, 0}   /* stop here */
 };
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Rewrite i2c_probe

2005-09-06 Thread Linux Kernel Mailing List
tree 98489ed77a287a81ff4ad7233fd543e59e58c328
parent 3b6c0634cc989f0735a1541ccf9288947685cab5
author Jean Delvare [EMAIL PROTECTED] Tue, 09 Aug 2005 20:17:55 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:25 -0700

[PATCH] I2C: Rewrite i2c_probe

i2c_probe was quite complex and slow, so I rewrote it in a more
efficient and hopefully clearer way.

Note that this slightly changes the way the module parameters are
handled. This shouldn't change anything for the most common cases
though.

For one thing, the function now respects the order of the parameters
for address probing. It used to always do lower addresses first. The
new approach gives the user more control.

For another, ignore addresses don't overrule probe addresses anymore.
This could have been restored the way it was at the cost of a few more
lines of code, but I don't think it's worth it. Both lists are given
as module parameters, so a user would be quite silly to specify the
same addresses in both lists. The normal addresses list is the only
one that isn't controlled by a module parameter, thus is the only one
the user may reasonably want to remove an address from.

Another significant change is the fact that i2c_probe() will no more
stop when a detection function returns -ENODEV. Just because a driver
found a chip it doesn't support isn't a valid reason to stop all
probings for this one driver. This closes the long standing lm_sensors
ticket #1807.

  http://www2.lm-sensors.nu/~lm78/readticket.cgi?ticket=1807

I updated the documentation accordingly.

In terms of algorithmic complexity, the new code is way better. If
I is the ignore address count, P the probe address count, N the
normal address count and F the force address count, the old code
was doing 128 * (F + I + P + N) iterations max, while the new code
does F + P + ((I+1) * N) iterations max. For the most common case
where F, I and P are empty, this is down from 128 * N to N.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/writing-clients |7 -
 drivers/i2c/i2c-core.c|  167 --
 2 files changed, 94 insertions(+), 80 deletions(-)

diff --git a/Documentation/i2c/writing-clients 
b/Documentation/i2c/writing-clients
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -241,9 +241,10 @@ Below, some things are only needed if th
 parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */
 markers. 
 
-This function should only return an error (any value != 0) if there is
-some reason why no more detection should be done anymore. If the
-detection just fails for this address, return 0.
+Returning an error different from -ENODEV in a detect function will cause
+the detection to stop: other addresses and adapters won't be scanned.
+This should only be done on fatal or internal errors, such as a memory
+shortage or i2c_attach_client failing.
 
 For now, you can ignore the `flags' parameter. It is there for future use.
 
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -662,107 +662,120 @@ int i2c_control(struct i2c_client *clien
  * Will not work for 10-bit addresses!
  * 
  */
-/* Return: kind (= 0) if force found, -1 if not found */
-static inline int i2c_probe_forces(struct i2c_adapter *adapter, int addr,
-  unsigned short **forces)
-{
-   unsigned short kind;
-   int j, adap_id = i2c_adapter_id(adapter);
-
-   for (kind = 0; forces[kind]; kind++) {
-   for (j = 0; forces[kind][j] != I2C_CLIENT_END; j += 2) {
-   if ((forces[kind][j] == adap_id ||
-forces[kind][j] == ANY_I2C_BUS)
- forces[kind][j + 1] == addr) {
-   dev_dbg(adapter-dev, found force parameter, 
-   addr 0x%02x, kind %u\n, addr, kind);
-   return kind;
-   }
-   }
+static int i2c_probe_address(struct i2c_adapter *adapter, int addr, int kind,
+int (*found_proc) (struct i2c_adapter *, int, int))
+{
+   int err;
+
+   /* Make sure the address is valid */
+   if (addr  0x03 || addr  0x77) {
+   dev_warn(adapter-dev, Invalid probe address 0x%02x\n,
+addr);
+   return -EINVAL;
}
 
-   return -1;
+   /* Skip if already in use */
+   if (i2c_check_addr(adapter, addr))
+   return 0;
+
+   /* Make sure there is something at this address, unless forced */
+   if (kind  0
+ i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL)  0)
+   return 0;
+
+   /* Finally call the custom detection function */
+   err = 

[PATCH] I2C: Centralize 24RF08 corruption prevention

2005-09-06 Thread Linux Kernel Mailing List
tree 30f34691bd61b55b11ec19f6fbc27ae69886eff8
parent a89ba0bc02e82920a0f4137aa5d655ac0366cc28
author Jean Delvare [EMAIL PROTECTED] Tue, 09 Aug 2005 20:28:10 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:25 -0700

[PATCH] I2C: Centralize 24RF08 corruption prevention

The 24RF08 corruption would better be prevented at i2c-core level than
at chip driver level, for several reasons:
* The second quick write should happen as soon as possible after the
  first one, so as to limit the risk that another command is issued on
  the bus inbetween, causing the corruption.
* As a matter of fact, the protection code at driver level was reworked
  at least three times already, which proves how hard it is to get it
  right there, while it's straightforward at i2c-core level.
* It's easy to add a new driver that would need the protection, and
  forget to add it. This did happen already.
* As additional probing addresses can be passed to most i2c chip drivers
  as module parameters, virtually every i2c chip driver would need the
  protection if we want to be really safe.
* Why duplicate code when we can easily avoid it?

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 Documentation/i2c/porting-clients |2 ++
 drivers/i2c/chips/eeprom.c|5 -
 drivers/i2c/chips/max6875.c   |5 -
 drivers/i2c/i2c-core.c|   13 ++---
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/Documentation/i2c/porting-clients 
b/Documentation/i2c/porting-clients
--- a/Documentation/i2c/porting-clients
+++ b/Documentation/i2c/porting-clients
@@ -90,6 +90,8 @@ Technical changes:
   device_create_file. Move the driver initialization before any
   sysfs file creation.
   Drop client-id.
+  Drop any 24RF08 corruption prevention you find, as this is now done
+  at the i2c-core level, and doing it twice voids it.
 
 * [Init] Limits must not be set by the driver (can be done later in
   user-space). Chip should not be reset default (although a module
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
--- a/drivers/i2c/chips/eeprom.c
+++ b/drivers/i2c/chips/eeprom.c
@@ -161,11 +161,6 @@ int eeprom_detect(struct i2c_adapter *ad
struct eeprom_data *data;
int err = 0;
 
-   /* prevent 24RF08 corruption */
-   if (kind  0)
-   i2c_smbus_xfer(adapter, address, 0, 0, 0,
-  I2C_SMBUS_QUICK, NULL);
-
/* There are three ways we can read the EEPROM data:
   (1) I2C block reads (faster, but unsupported by most adapters)
   (2) Consecutive byte reads (100% overhead)
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c
--- a/drivers/i2c/chips/max6875.c
+++ b/drivers/i2c/chips/max6875.c
@@ -171,11 +171,6 @@ static int max6875_detect(struct i2c_ada
struct max6875_data *data;
int err = 0;
 
-   /* Prevent 24rf08 corruption (in case of user error) */
-   if (kind  0)
-   i2c_smbus_xfer(adapter, address, 0, 0, 0,
-  I2C_SMBUS_QUICK, NULL);
-
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA
 | I2C_FUNC_SMBUS_READ_BYTE))
return 0;
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -679,9 +679,16 @@ static int i2c_probe_address(struct i2c_
return 0;
 
/* Make sure there is something at this address, unless forced */
-   if (kind  0
- i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL)  0)
-   return 0;
+   if (kind  0) {
+   if (i2c_smbus_xfer(adapter, addr, 0, 0, 0,
+  I2C_SMBUS_QUICK, NULL)  0)
+   return 0;
+
+   /* prevent 24RF08 corruption */
+   if ((addr  ~0x0f) == 0x50)
+   i2c_smbus_xfer(adapter, addr, 0, 0, 0,
+  I2C_SMBUS_QUICK, NULL);
+   }
 
/* Finally call the custom detection function */
err = found_proc(adapter, addr, kind);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Kill i2c_algorithm.id (2/7)

2005-09-06 Thread Linux Kernel Mailing List
tree fb09b8c3b44047771a395c5430bdba1e42f4ac17
parent 975185880d55676b1352047e82a0cb84173c6c28
author Jean Delvare [EMAIL PROTECTED] Thu, 11 Aug 2005 23:36:49 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:28 -0700

[PATCH] I2C: Kill i2c_algorithm.id (2/7)

Use the adapter id rather than the algorithm id to detect the i2c-isa
pseudo-adapter. This saves one level of dereferencing, and the
algorithm ids will soon be gone anyway.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/busses/i2c-isa.c |1 +
 include/linux/i2c-isa.h  |6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c
--- a/drivers/i2c/busses/i2c-isa.c
+++ b/drivers/i2c/busses/i2c-isa.c
@@ -50,6 +50,7 @@ static struct i2c_algorithm isa_algorith
 /* There can only be one... */
 static struct i2c_adapter isa_adapter = {
.owner  = THIS_MODULE,
+   .id = I2C_ALGO_ISA | I2C_HW_ISA,
.class  = I2C_CLASS_HWMON,
.algo   = isa_algorithm,
.name   = ISA main adapter,
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h
--- a/include/linux/i2c-isa.h
+++ b/include/linux/i2c-isa.h
@@ -28,9 +28,9 @@ extern int i2c_isa_del_driver(struct i2c
 
 /* Detect whether we are on the isa bus. This is only useful to hybrid
(i2c+isa) drivers. */
-#define i2c_is_isa_client(clientptr) \
-((clientptr)-adapter-algo-id == I2C_ALGO_ISA)
 #define i2c_is_isa_adapter(adapptr) \
-((adapptr)-algo-id == I2C_ALGO_ISA)
+((adapptr)-id == (I2C_ALGO_ISA | I2C_HW_ISA))
+#define i2c_is_isa_client(clientptr) \
+i2c_is_isa_adapter((clientptr)-adapter)
 
 #endif /* _LINUX_I2C_ISA_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Kill i2c_algorithm.id (5/7)

2005-09-06 Thread Linux Kernel Mailing List
tree 4b952a757d60d9cfa4aad8462ee8ef7e03fec6dd
parent 1d8b9e1bad35fa3ea829990b9056c2a257d8fe79
author Jean Delvare [EMAIL PROTECTED] Thu, 11 Aug 2005 23:41:56 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:31 -0700

[PATCH] I2C: Kill i2c_algorithm.id (5/7)

Merge the algorithm id part (16 upper bits) of the i2c adapters ids
into the definition of the adapters ids directly. After that, we don't
need to OR both ids together for each i2c_adapter structure.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/algos/i2c-algo-bit.c   |2 
 drivers/i2c/algos/i2c-algo-ite.c   |2 
 drivers/i2c/algos/i2c-algo-pca.c   |2 
 drivers/i2c/algos/i2c-algo-pcf.c   |2 
 drivers/i2c/algos/i2c-algo-sgi.c   |1 
 drivers/i2c/algos/i2c-algo-sibyte.c|2 
 drivers/i2c/busses/i2c-ibm_iic.c   |2 
 drivers/i2c/busses/i2c-isa.c   |2 
 drivers/i2c/busses/i2c-mpc.c   |2 
 drivers/i2c/busses/i2c-mv64xxx.c   |2 
 drivers/media/video/bt832.c|2 
 drivers/media/video/bttv-i2c.c |2 
 drivers/media/video/ir-kbd-i2c.c   |2 
 drivers/media/video/ovcamchip/ov6x20.c |6 -
 drivers/media/video/ovcamchip/ov6x30.c |4 
 drivers/media/video/ovcamchip/ovcamchip_core.c |8 -
 drivers/media/video/tda7432.c  |2 
 drivers/media/video/tda9875.c  |2 
 drivers/media/video/tda9887.c  |4 
 drivers/media/video/tuner-3036.c   |2 
 drivers/media/video/tvaudio.c  |6 -
 drivers/media/video/tveeprom.c |2 
 drivers/media/video/tvmixer.c  |6 -
 drivers/usb/media/w9968cf.c|2 
 drivers/video/matrox/matroxfb_maven.c  |2 
 include/linux/i2c-id.h |  128 -
 include/linux/i2c-isa.h|2 
 27 files changed, 95 insertions(+), 106 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -539,8 +539,6 @@ int i2c_bit_add_bus(struct i2c_adapter *
DEB2(dev_dbg(adap-dev, hw routines registered.\n));
 
/* register new adapter to i2c module... */
-
-   adap-id |= I2C_ALGO_BIT;
adap-algo = i2c_bit_algo;
 
adap-timeout = 100;/* default values, should   */
diff --git a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c
--- a/drivers/i2c/algos/i2c-algo-ite.c
+++ b/drivers/i2c/algos/i2c-algo-ite.c
@@ -736,8 +736,6 @@ int i2c_iic_add_bus(struct i2c_adapter *
adap-name));
 
/* register new adapter to i2c module... */
-
-   adap-id |= I2C_ALGO_IIC;
adap-algo = iic_algo;
 
adap-timeout = 100;/* default values, should   */
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -369,8 +369,6 @@ int i2c_pca_add_bus(struct i2c_adapter *
int rval;
 
/* register new adapter to i2c module... */
-
-   adap-id |= I2C_ALGO_PCA;
adap-algo = pca_algo;
 
adap-timeout = 100;/* default values, should   */
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -474,8 +474,6 @@ int i2c_pcf_add_bus(struct i2c_adapter *
DEB2(dev_dbg(adap-dev, hw routines registered.\n));
 
/* register new adapter to i2c module... */
-
-   adap-id |= I2C_ALGO_PCF;
adap-algo = pcf_algo;
 
adap-timeout = 100;/* default values, should   */
diff --git a/drivers/i2c/algos/i2c-algo-sgi.c b/drivers/i2c/algos/i2c-algo-sgi.c
--- a/drivers/i2c/algos/i2c-algo-sgi.c
+++ b/drivers/i2c/algos/i2c-algo-sgi.c
@@ -167,7 +167,6 @@ static struct i2c_algorithm sgi_algo = {
  */
 int i2c_sgi_add_bus(struct i2c_adapter *adap)
 {
-   adap-id |= I2C_ALGO_SGI;
adap-algo = sgi_algo;
 
return i2c_add_adapter(adap);
diff --git a/drivers/i2c/algos/i2c-algo-sibyte.c 
b/drivers/i2c/algos/i2c-algo-sibyte.c
--- a/drivers/i2c/algos/i2c-algo-sibyte.c
+++ b/drivers/i2c/algos/i2c-algo-sibyte.c
@@ -149,8 +149,6 @@ int i2c_sibyte_add_bus(struct i2c_adapte
struct i2c_algo_sibyte_data *adap = i2c_adap-algo_data;
 
/* register new adapter to i2c module... */
-
-   i2c_adap-id |= I2C_ALGO_SIBYTE;
i2c_adap-algo = i2c_sibyte_algo;
 
 /* Set the frequency to 100 kHz */
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ 

[PATCH] I2C: Kill i2c_algorithm.id (6/7)

2005-09-06 Thread Linux Kernel Mailing List
tree 5ba646c7c81f1ed3a2bbc032a412dcff21fc7c37
parent c7a46533ff7ef9e1c51bae6e54208527c5275b24
author Jean Delvare [EMAIL PROTECTED] Thu, 11 Aug 2005 23:51:10 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:32 -0700

[PATCH] I2C: Kill i2c_algorithm.id (6/7)

In theory, there should be no more users of I2C_ALGO_* at this point.
However, it happens that several drivers were using I2C_ALGO_* for
adapter ids, so we need to correct these before we can get rid of all
the I2C_ALGO_* definitions.

Note that this also fixes a bug in media/video/tvaudio.c:

/* don't attach on saa7146 based cards,
   because dedicated drivers are used */
if ((adap-id  I2C_ALGO_SAA7146))
return 0;

This test was plain broken, as it would succeed for many more adapters
than just the saa7146: any those id would share at least one bit with
the saa7146 id. We are really lucky that the few other adapters we want
this driver to work with did not fulfill that condition.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/busses/i2c-keywest.c  |1 -
 drivers/i2c/busses/scx200_acb.c   |2 +-
 drivers/media/common/saa7146_i2c.c|2 +-
 drivers/media/dvb/b2c2/flexcop-i2c.c  |1 -
 drivers/media/dvb/dvb-usb/dvb-usb-i2c.c   |1 -
 drivers/media/dvb/pluto2/pluto2.c |1 -
 drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c |1 -
 drivers/media/video/ir-kbd-i2c.c  |2 +-
 drivers/media/video/saa7134/saa7134-i2c.c |2 +-
 drivers/media/video/tda9840.c |2 +-
 drivers/media/video/tda9887.c |2 +-
 drivers/media/video/tea6415c.c|2 +-
 drivers/media/video/tea6420.c |2 +-
 drivers/media/video/tvaudio.c |4 ++--
 drivers/video/aty/radeon_i2c.c|2 +-
 drivers/video/nvidia/nv_i2c.c |3 +--
 drivers/video/riva/rivafb-i2c.c   |3 +--
 drivers/video/savage/savagefb-i2c.c   |3 +--
 include/linux/i2c-id.h|7 +++
 include/media/id.h|5 -
 20 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
--- a/drivers/i2c/busses/i2c-keywest.c
+++ b/drivers/i2c/busses/i2c-keywest.c
@@ -619,7 +619,6 @@ create_iface(struct device_node *np, str
sprintf(chan-adapter.name, %s %d, np-parent-name, i);
chan-iface = iface;
chan-chan_no = i;
-   chan-adapter.id = I2C_ALGO_SMBUS;
chan-adapter.algo = keywest_algorithm;
chan-adapter.algo_data = NULL;
chan-adapter.client_register = NULL;
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -454,7 +454,7 @@ static int  __init scx200_acb_create(int
i2c_set_adapdata(adapter, iface);
snprintf(adapter-name, I2C_NAME_SIZE, SCx200 ACB%d, index);
adapter-owner = THIS_MODULE;
-   adapter-id = I2C_ALGO_SMBUS;
+   adapter-id = I2C_HW_SMBUS_SCX200;
adapter-algo = scx200_acb_algorithm;
adapter-class = I2C_CLASS_HWMON;
 
diff --git a/drivers/media/common/saa7146_i2c.c 
b/drivers/media/common/saa7146_i2c.c
--- a/drivers/media/common/saa7146_i2c.c
+++ b/drivers/media/common/saa7146_i2c.c
@@ -410,7 +410,7 @@ int saa7146_i2c_adapter_prepare(struct s
 #endif
i2c_adapter-algo  = saa7146_algo;
i2c_adapter-algo_data = NULL;
-   i2c_adapter-id= I2C_ALGO_SAA7146;
+   i2c_adapter-id= I2C_HW_SAA7146;
i2c_adapter-timeout = SAA7146_I2C_TIMEOUT;
i2c_adapter-retries = SAA7146_I2C_RETRIES;
}
diff --git a/drivers/media/dvb/b2c2/flexcop-i2c.c 
b/drivers/media/dvb/b2c2/flexcop-i2c.c
--- a/drivers/media/dvb/b2c2/flexcop-i2c.c
+++ b/drivers/media/dvb/b2c2/flexcop-i2c.c
@@ -190,7 +190,6 @@ int flexcop_i2c_init(struct flexcop_devi
fc-i2c_adap.class  = I2C_CLASS_TV_DIGITAL;
fc-i2c_adap.algo   = flexcop_algo;
fc-i2c_adap.algo_data  = NULL;
-   fc-i2c_adap.id = I2C_ALGO_BIT;
 
if ((ret = i2c_add_adapter(fc-i2c_adap))  0)
return ret;
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c 
b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
--- a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c
@@ -27,7 +27,6 @@ int dvb_usb_i2c_init(struct dvb_usb_devi
 #endif
d-i2c_adap.algo  = d-props.i2c_algo;
d-i2c_adap.algo_data = NULL;
-   d-i2c_adap.id= I2C_ALGO_BIT;
 

[PATCH] I2C: Kill i2c_algorithm.id (7/7)

2005-09-06 Thread Linux Kernel Mailing List
tree 8cadb4f44e1efb66916ce0abe2ba290771336d3f
parent 1684a984303abbfc39aa8b59b0fe825c717811a9
author Jean Delvare [EMAIL PROTECTED] Thu, 11 Aug 2005 23:52:35 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:33 -0700

[PATCH] I2C: Kill i2c_algorithm.id (7/7)

The I2C_ALGO_* constants have no more users, delete them. Also update
the comments in i2c-id.h so that they reflect the current state of the
file.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 include/linux/i2c-id.h |   57 -
 1 files changed, 1 insertion(+), 56 deletions(-)

diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -1,6 +1,6 @@
 /* - */
 /*  */
-/* i2c.h - definitions for the i2c-bus interface*/
+/* i2c-id.h - identifier values for i2c drivers and adapters*/
 /*  */
 /* - */
 /*   Copyright (C) 1995-1999 Simon G. Vogl
@@ -24,16 +24,6 @@
 #define LINUX_I2C_ID_H
 
 /*
- * This file is part of the i2c-bus package and contains the identifier
- * values for drivers, adapters and other folk populating these serial
- * worlds. 
- *
- * These will change often (i.e. additions) , therefore this has been 
- * separated from the functional interface definitions of the i2c api.
- *
- */
-
-/*
  *  Driver types -
  *   device id name + numberfunction description, i2c address(es)
  *
@@ -170,51 +160,6 @@
 
 /*
  *  Adapter types 
- *
- * First, we distinguish between several algorithms to access the hardware
- * interface types, as a PCF 8584 needs other care than a bit adapter.
- */
-
-#define I2C_ALGO_NONE  0x00
-#define I2C_ALGO_BIT   0x01/* bit style adapters   */
-#define I2C_ALGO_PCF   0x02/* PCF 8584 style adapters  */
-#define I2C_ALGO_ATI   0x03/* ATI video card   */
-#define I2C_ALGO_SMBUS 0x04
-#define I2C_ALGO_ISA   0x05/* lm_sensors ISA pseudo-adapter */
-#define I2C_ALGO_SAA7146 0x06  /* SAA 7146 video decoder bus   */
-#define I2C_ALGO_ACB   0x07/* ACCESS.bus algorithm */
-#define I2C_ALGO_IIC0x08   /* ITE IIC bus */
-#define I2C_ALGO_SAA7134 0x09
-#define I2C_ALGO_MPC824X 0x0a  /* Motorola 8240 / 8245 */
-#define I2C_ALGO_IPMI  0x0b/* IPMI dummy adapter */
-#define I2C_ALGO_IPMB  0x0c/* IPMB adapter */
-#define I2C_ALGO_MPC107 0x0d
-#define I2C_ALGO_EC 0x10/* ACPI embedded controller */
-
-#define I2C_ALGO_MPC8XX 0x11   /* MPC8xx PowerPC I2C algorithm */
-#define I2C_ALGO_OCP0x12   /* IBM or otherwise On-chip I2C 
algorithm */
-#define I2C_ALGO_BITHS 0x13/* enhanced bit style adapters  */
-#define I2C_ALGO_IOP3XX0x14/* XSCALE IOP3XX On-chip I2C 
alg */
-#define I2C_ALGO_SIBYTE 0x15   /* Broadcom SiByte SOCs */
-#define I2C_ALGO_SGI   0x16/* SGI algorithm*/
-
-#define I2C_ALGO_USB   0x17/* USB algorithm*/
-#define I2C_ALGO_VIRT  0x18/* Virtual bus adapter  */
-
-#define I2C_ALGO_MV64XXX 0x19  /* Marvell mv64xxx i2c ctlr */
-#define I2C_ALGO_PCA   0x1a/* PCA 9564 style adapters  */
-#define I2C_ALGO_AU15500x1b/* Au1550 PSC algorithm 
*/
-
-#define I2C_ALGO_EXP   0x80/* experimental */
-
-#define I2C_ALGO_MASK  0xff/* Mask for algorithms  */
-#define I2C_ALGO_SHIFT 0x10/* right shift to get index values  */
-
-#define I2C_HW_ADAPS   0x1 /* # adapter types  */
-#define I2C_HW_MASK0x  
-
-
-/* hw specific modules that are defined per algorithm layer
  */
 
 /* --- Bit algorithm adapters  */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Outdated i2c_adapter comment

2005-09-06 Thread Linux Kernel Mailing List
tree 71634ce861f1bed2159a9db16c83004015996e59
parent c2459cf257106cea5adbc83f084b76d0030eb700
author Jean Delvare [EMAIL PROTECTED] Sat, 13 Aug 2005 13:04:32 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:33 -0700

[PATCH] I2C: Outdated i2c_adapter comment

Delete an outdated comment about i2c_algorithm.id being computed
from algo-id.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 include/linux/i2c.h |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -219,8 +219,7 @@ struct i2c_algorithm {
  */
 struct i2c_adapter {
struct module *owner;
-   unsigned int id;/* == is algo-id | hwdep.struct-id,   */
-   /* for registered values see below  */
+   unsigned int id;
unsigned int class;
struct i2c_algorithm *algo;/* the algorithm to access the bus   */
void *algo_data;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: separate maintainer

2005-09-06 Thread Linux Kernel Mailing List
tree 4ad52bac0fcc4cff98f22e3cb6c0abbcacfc1c70
parent 020789e9cb688ac8b15a9950d25fe45492b23398
author Jean Delvare [EMAIL PROTECTED] Mon, 15 Aug 2005 19:51:02 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:14:35 -0700

[PATCH] hwmon: separate maintainer

Now that the hardware monitoring drivers are no more part of the i2c
subsystem, they probably deserve their own entry in MAINTAINERS.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 MAINTAINERS |9 -
 1 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -933,6 +933,13 @@ M: [EMAIL PROTECTED]
 W: http://www.kernel.org/pub/linux/utils/net/hdlc/
 S: Maintained
 
+HARDWARE MONITORING
+P: Jean Delvare
+M: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED]
+W: http://www.lm-sensors.nu/
+S: Maintained
+
 HARMONY SOUND DRIVER
 P: Kyle McMartin
 M: [EMAIL PROTECTED]
@@ -1014,7 +1021,7 @@ P:William Irwin
 M: [EMAIL PROTECTED]
 S: Maintained
 
-I2C AND SENSORS DRIVERS
+I2C SUBSYSTEM
 P: Greg Kroah-Hartman
 M: [EMAIL PROTECTED]
 P: Jean Delvare
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Drop debug eeprom dump code in pcilynx

2005-09-06 Thread Linux Kernel Mailing List
tree 15746d1a5c66fa476487a7f95d84115f86ac3f81
parent 4e0c64cfc1126a2946487d4771168458bb9ba9be
author Jean Delvare [EMAIL PROTECTED] Thu, 25 Aug 2005 16:43:29 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:26:52 -0700

[PATCH] I2C: Drop debug eeprom dump code in pcilynx

The pcilynx driver includes code to dump the contents of an i2c eeprom
for debugging purposes. The same can be done from userspace using the
i2cdump tool (part of the lm_sensors project) instead, in a more
efficient and flexible way.

Thus I would suggest that this functionality be simply dropped from the
pcilynx driver.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/ieee1394/pcilynx.c |   20 
 1 files changed, 20 deletions(-)

diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
--- a/drivers/ieee1394/pcilynx.c
+++ b/drivers/ieee1394/pcilynx.c
@@ -1464,26 +1464,6 @@ static int __devinit add_card(struct pci
   { 0x50, I2C_M_RD, 20, 
(unsigned char*) lynx-bus_info_block }
 };
 
-
-#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
-union i2c_smbus_data data;
-
-if (i2c_smbus_xfer(i2c_ad, 80, 0, I2C_SMBUS_WRITE, 0, 
I2C_SMBUS_BYTE,NULL))
-PRINT(KERN_ERR, lynx-id,eeprom read start 
has failed);
-else
-{
-u16 addr;
-for (addr=0x00; addr  0x100; addr++) {
-if (i2c_smbus_xfer(i2c_ad, 80, 0, 
I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, data)) {
-PRINT(KERN_ERR, lynx-id, 
unable to read i2c %x, addr);
-break;
-}
-else
-PRINT(KERN_DEBUG, 
lynx-id,got serial eeprom data at %x: %x,addr, data.byte);
-}
-}
-#endif
-
 /* we use i2c_transfer, because 
i2c_smbus_read_block_data does not work properly and we
do it more efficiently in one transaction rather 
then using several reads */
 if (i2c_transfer(i2c_ad, msg, 2)  0) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] I2C: Drop probe parameter of i2c-keywest

2005-09-06 Thread Linux Kernel Mailing List
tree 591ad43d6466310312254f6bd1766f9e1e92f010
parent 386625f9f5cd94d10a21241b555b130dcec484fb
author Jean Delvare [EMAIL PROTECTED] Mon, 29 Aug 2005 21:10:31 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:26:52 -0700

[PATCH] I2C: Drop probe parameter of i2c-keywest

The i2c-keywest driver has a probe module parameter which enables bus
scanning at load time. This can be done in userspace with the i2cdetect
tool (part of the lm_sensors package) instead. What's more, i2cdetect
gives more control on the way the bus is scanned, and is safer
(i2c-keywest currently scans reserved addresses and doesn't properly
handle the famous 24RF08 corruption case.)

Thus, I would propose that this module parameter be simply dropped.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Acked-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/busses/i2c-keywest.c |   12 
 1 files changed, 12 deletions(-)

diff --git a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
--- a/drivers/i2c/busses/i2c-keywest.c
+++ b/drivers/i2c/busses/i2c-keywest.c
@@ -87,12 +87,9 @@ static const char *__kw_state_names[] = 
 };
 #endif /* DEBUG */
 
-static int probe;
-
 MODULE_AUTHOR(Benjamin Herrenschmidt [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(I2C driver for Apple's Keywest);
 MODULE_LICENSE(GPL);
-module_param(probe, bool, 0);
 
 #ifdef POLLED_MODE
 /* Don't schedule, the g5 fan controller is too
@@ -632,15 +629,6 @@ create_iface(struct device_node *np, str
chan-adapter.name);
i2c_set_adapdata(chan-adapter, NULL);
}
-   if (probe) {
-   printk(Probe: );
-   for (addr = 0x00; addr = 0x7f; addr++) {
-   if (i2c_smbus_xfer(chan-adapter,addr,
-   0,0,0,I2C_SMBUS_QUICK,NULL) = 0)
-   printk(%02x , addr);
-   }
-   printk(\n);
-   }
}
 
printk(KERN_INFO Found KeyWest i2c on \%s\, %d channel%s, stepping: 
%d bits\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] i2c: chips/m41t00.c fixup

2005-09-06 Thread Linux Kernel Mailing List
tree 2ad3bac3e7ce7a64d91c9bba636a1f59372a83d7
parent b280dab6d62c8d0434cbc0aaeebf56d1fa4fcc19
author Mark A. Greer [EMAIL PROTECTED] Fri, 02 Sep 2005 08:09:54 -0700
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:26:53 -0700

[PATCH] i2c: chips/m41t00.c fixup

The 'new_time' variable should be static.

Signed-off-by: Mark A. Greer [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/chips/m41t00.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c
--- a/drivers/i2c/chips/m41t00.c
+++ b/drivers/i2c/chips/m41t00.c
@@ -144,7 +144,7 @@ m41t00_set_tlet(ulong arg)
return;
 }
 
-ulong  new_time;
+static ulong   new_time;
 
 DECLARE_TASKLET_DISABLED(m41t00_tasklet, m41t00_set_tlet, (ulong)new_time);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] i2c: bug fix for busses/i2c-mv64xxx.c

2005-09-06 Thread Linux Kernel Mailing List
tree 292f29b437f14c9af06ac276be48004ec1df8460
parent 8e14d6c173f8fff05a94e62669c87c26141766af
author Jean Delvare [EMAIL PROTECTED] Fri, 02 Sep 2005 21:25:47 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:26:53 -0700

[PATCH] i2c: bug fix for busses/i2c-mv64xxx.c

When an i2c transfer is successful, an incorrect value is returned.
This patch fixes that.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/i2c/busses/i2c-mv64xxx.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -423,13 +423,13 @@ static int
 mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 {
struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap);
-   int i, rc = 0;
+   int i, rc;
 
for (i=0; inum; i++)
-   if ((rc = mv64xxx_i2c_execute_msg(drv_data, msgs[i])) != 0)
-   break;
+   if ((rc = mv64xxx_i2c_execute_msg(drv_data, msgs[i]))  0)
+   return rc;
 
-   return rc;
+   return num;
 }
 
 static struct i2c_algorithm mv64xxx_i2c_algo = {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hwmon: (3/3) pc87360 driver update

2005-09-06 Thread Linux Kernel Mailing List
tree 84d4952d0784b42990a3fbe1836d47992a22448d
parent 694fa056a60828ef54a5db958468cc600c3b3622
author Jim Cromie [EMAIL PROTECTED] Fri, 02 Sep 2005 23:05:07 +0200
committer Greg Kroah-Hartman [EMAIL PROTECTED] Mon, 05 Sep 2005 23:26:55 -0700

[PATCH] hwmon: (3/3) pc87360 driver update

pc87360: consolidate fan helper

This patch consolidates the _set_fan_min() helper routine into the 2
line sysfs-callback wrapper that uses it.

Signed-off-by: Jim Cromie [EMAIL PROTECTED]
Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

 drivers/hwmon/pc87360.c |   54 +---
 1 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -246,35 +246,6 @@ static struct i2c_driver pc87360_driver 
  * Sysfs stuff
  */
 
-static ssize_t _set_fan_min(struct device *dev, const char *buf,
-   size_t count, int nr)
-{
-   struct i2c_client *client = to_i2c_client(dev);
-   struct pc87360_data *data = i2c_get_clientdata(client);
-   long fan_min = simple_strtol(buf, NULL, 10);
-
-   down(data-update_lock);
-   fan_min = FAN_TO_REG(fan_min, FAN_DIV_FROM_REG(data-fan_status[nr]));
-
-   /* If it wouldn't fit, change clock divisor */
-   while (fan_min  255
-(data-fan_status[nr]  0x60) != 0x60) {
-   fan_min = 1;
-   data-fan[nr] = 1;
-   data-fan_status[nr] += 0x20;
-   }
-   data-fan_min[nr] = fan_min  255 ? 255 : fan_min;
-   pc87360_write_value(data, LD_FAN, NO_BANK, PC87360_REG_FAN_MIN(nr),
-   data-fan_min[nr]);
-
-   /* Write new divider, preserve alarm bits */
-   pc87360_write_value(data, LD_FAN, NO_BANK, PC87360_REG_FAN_STATUS(nr),
-   data-fan_status[nr]  0xF9);
-   up(data-update_lock);
-
-   return count;
-}
-
 static ssize_t show_fan_input(struct device *dev, struct device_attribute 
*devattr, char *buf)
 {
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
@@ -307,7 +278,30 @@ static ssize_t set_fan_min(struct device
size_t count)
 {
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
-   return _set_fan_min(dev, buf, count, attr-index);
+   struct i2c_client *client = to_i2c_client(dev);
+   struct pc87360_data *data = i2c_get_clientdata(client);
+   long fan_min = simple_strtol(buf, NULL, 10);
+
+   down(data-update_lock);
+   fan_min = FAN_TO_REG(fan_min, 
FAN_DIV_FROM_REG(data-fan_status[attr-index]));
+
+   /* If it wouldn't fit, change clock divisor */
+   while (fan_min  255
+(data-fan_status[attr-index]  0x60) != 0x60) {
+   fan_min = 1;
+   data-fan[attr-index] = 1;
+   data-fan_status[attr-index] += 0x20;
+   }
+   data-fan_min[attr-index] = fan_min  255 ? 255 : fan_min;
+   pc87360_write_value(data, LD_FAN, NO_BANK, 
PC87360_REG_FAN_MIN(attr-index),
+   data-fan_min[attr-index]);
+
+   /* Write new divider, preserve alarm bits */
+   pc87360_write_value(data, LD_FAN, NO_BANK, 
PC87360_REG_FAN_STATUS(attr-index),
+   data-fan_status[attr-index]  0xF9);
+   up(data-update_lock);
+
+   return count;
 }
 
 #define show_and_set_fan(offset) \
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MOXA]: Fix this driver properly.

2005-09-06 Thread Linux Kernel Mailing List
tree 96a2a7d68af533283e59f055033a7d5fd44d0dda
parent 67d2c36e901403bb97cb79ddb44d702c3284d0ba
author Al Viro [EMAIL PROTECTED] Tue, 06 Sep 2005 13:30:15 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 13:30:15 -0700

[MOXA]: Fix this driver properly.

Actually, proper fix of that breakage is embarrassingly simple - it's yet
another gratitious leftover include of asm/segment.h, so incremental to the
previos would be removal of that BROKEN and removal of bogus include from
mxser.c itself.

Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/char/Kconfig |2 +-
 drivers/char/mxser.c |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -175,7 +175,7 @@ config MOXA_INTELLIO
 
 config MOXA_SMARTIO
tristate Moxa SmartIO support
-   depends on SERIAL_NONSTANDARD  (BROKEN || !SPARC32)
+   depends on SERIAL_NONSTANDARD
help
  Say Y here if you have a Moxa SmartIO multiport serial card.
 
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -63,7 +63,6 @@
 #include asm/system.h
 #include asm/io.h
 #include asm/irq.h
-#include asm/segment.h
 #include asm/bitops.h
 #include asm/uaccess.h
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RTC]: Use SA_SHIRQ in sparc specific code.

2005-09-06 Thread Linux Kernel Mailing List
tree 22686ede46dd7f3207d09a65cbc88da14032b9d8
parent 1d25240fcfce0e55540a273b1e1b07d304065a31
author David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 13:33:05 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 13:33:05 -0700

[RTC]: Use SA_SHIRQ in sparc specific code.

Based upon a report from Jason Wever.

Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/char/rtc.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -938,10 +938,9 @@ found:
 
/*
 * XXX Interrupt pin #7 in Espresso is shared between RTC and
-* PCI Slot 2 INTA# (and some INTx# in Slot 1). SA_INTERRUPT here
-* is asking for trouble with add-on boards. Change to SA_SHIRQ.
+* PCI Slot 2 INTA# (and some INTx# in Slot 1).
 */
-   if (request_irq(rtc_irq, rtc_interrupt, SA_INTERRUPT, rtc, (void 
*)rtc_port)) {
+   if (request_irq(rtc_irq, rtc_interrupt, SA_SHIRQ, rtc, (void 
*)rtc_port)) {
/*
 * Standard way for sparc to print irq's is to use
 * __irq_itoa(). I think for EBus it's ok to use %d.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SUNSU]: Compile fixes.

2005-09-06 Thread Linux Kernel Mailing List
tree 982de5c45f41b6372f722fc3339f28be84c2efe9
parent e5e259466f2fe68251b1e1092949ef3d4dabb254
author Al Viro [EMAIL PROTECTED] Tue, 06 Sep 2005 13:35:05 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 13:35:05 -0700

[SUNSU]: Compile fixes.

sunsu had been broken by -stop_tx/-start_tx API changes.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/serial/sunsu.c |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -269,7 +269,10 @@ static void sunsu_stop_tx(struct uart_po
 
__stop_tx(up);
 
-   if (up-port.type == PORT_16C950  tty_stop /*FIXME*/) {
+   /*
+* We really want to stop the transmitter from sending.
+*/
+   if (up-port.type == PORT_16C950) {
up-acr |= UART_ACR_TXDIS;
serial_icr_write(up, UART_ACR, up-acr);
}
@@ -283,10 +286,11 @@ static void sunsu_start_tx(struct uart_p
up-ier |= UART_IER_THRI;
serial_out(up, UART_IER, up-ier);
}
+
/*
-* We only do this from uart_start
+* Re-enable the transmitter if we disabled it.
 */
-   if (tty_start  up-port.type == PORT_16C950 /*FIXME*/) {
+   if (up-port.type == PORT_16C950  up-acr  UART_ACR_TXDIS) {
up-acr = ~UART_ACR_TXDIS;
serial_icr_write(up, UART_ACR, up-acr);
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Minor 5780 and 5752 fixes

2005-09-06 Thread Linux Kernel Mailing List
tree c80f671c4a04683d9efd7a6763d82cadaa459203
parent 67d2c36e901403bb97cb79ddb44d702c3284d0ba
author Michael Chan [EMAIL PROTECTED] Tue, 06 Sep 2005 07:52:38 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:52:38 -0700

[TG3]: Minor 5780 and 5752 fixes

Minor SerDes bug fixes for 5780S and nvram bug fixes for 5780 and
5752.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/net/tg3.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5962,7 +5962,7 @@ static int tg3_reset_hw(struct tg3 *tp)
tw32(MAC_LED_CTRL, tp-led_ctrl);
 
tw32(MAC_MI_STAT, MAC_MI_STAT_LNKSTAT_ATTN_ENAB);
-   if (tp-tg3_flags2  TG3_FLG2_PHY_SERDES) {
+   if (tp-tg3_flags2  TG3_FLG2_ANY_SERDES) {
tw32_f(MAC_RX_MODE, RX_MODE_RESET);
udelay(10);
}
@@ -7618,7 +7618,7 @@ static int tg3_test_link(struct tg3 *tp)
if (!netif_running(tp-dev))
return -ENODEV;
 
-   if (tp-tg3_flags2  TG3_FLG2_PHY_SERDES)
+   if (tp-tg3_flags2  TG3_FLG2_ANY_SERDES)
max = TG3_SERDES_TIMEOUT_SEC;
else
max = TG3_COPPER_TIMEOUT_SEC;
@@ -8305,7 +8305,8 @@ static void __devinit tg3_get_nvram_info
tw32(NVRAM_CFG1, nvcfg1);
}
 
-   if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5750) {
+   if ((GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5750) ||
+   (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5780)) {
switch (nvcfg1  NVRAM_CFG1_VENDOR_MASK) {
case FLASH_VENDOR_ATMEL_FLASH_BUFFERED:
tp-nvram_jedecnum = JEDEC_ATMEL;
@@ -8719,8 +8720,9 @@ static int tg3_nvram_write_block_buffere
if (i == (len - 4))
nvram_cmd |= NVRAM_CMD_LAST;
 
-   if ((tp-nvram_jedecnum == JEDEC_ST) 
-   (nvram_cmd  NVRAM_CMD_FIRST)) {
+   if ((GET_ASIC_REV(tp-pci_chip_rev_id) != ASIC_REV_5752) 
+   (tp-nvram_jedecnum == JEDEC_ST) 
+   (nvram_cmd  NVRAM_CMD_FIRST)) {
 
if ((ret = tg3_nvram_exec_cmd(tp,
NVRAM_CMD_WREN | NVRAM_CMD_GO |
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Add ethtool -p support

2005-09-06 Thread Linux Kernel Mailing List
tree 1571d9399aa0ae6ba0472b59179d447ac8185a80
parent 4c98748763ce25c5394a7edd686d92c70b4fac38
author Michael Chan [EMAIL PROTECTED] Tue, 06 Sep 2005 07:52:54 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:52:54 -0700

[TG3]: Add ethtool -p support

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]


 drivers/net/tg3.c |   33 +
 1 files changed, 33 insertions(+)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7559,6 +7559,38 @@ static void tg3_get_strings (struct net_
}
 }
 
+static int tg3_phys_id(struct net_device *dev, u32 data)
+{
+   struct tg3 *tp = netdev_priv(dev);
+   int i;
+
+   if (!netif_running(tp-dev))
+   return -EAGAIN;
+
+   if (data == 0)
+   data = 2;
+
+   for (i = 0; i  (data * 2); i++) {
+   if ((i % 2) == 0)
+   tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
+  LED_CTRL_1000MBPS_ON |
+  LED_CTRL_100MBPS_ON |
+  LED_CTRL_10MBPS_ON |
+  LED_CTRL_TRAFFIC_OVERRIDE |
+  LED_CTRL_TRAFFIC_BLINK |
+  LED_CTRL_TRAFFIC_LED);
+   
+   else
+   tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
+  LED_CTRL_TRAFFIC_OVERRIDE);
+
+   if (msleep_interruptible(500))
+   break;
+   }
+   tw32(MAC_LED_CTRL, tp-led_ctrl);
+   return 0;
+}
+
 static void tg3_get_ethtool_stats (struct net_device *dev,
   struct ethtool_stats *estats, u64 *tmp_stats)
 {
@@ -8241,6 +8273,7 @@ static struct ethtool_ops tg3_ethtool_op
.self_test_count= tg3_get_test_count,
.self_test  = tg3_self_test,
.get_strings= tg3_get_strings,
+   .phys_id= tg3_phys_id,
.get_stats_count= tg3_get_stats_count,
.get_ethtool_stats  = tg3_get_ethtool_stats,
.get_coalesce   = tg3_get_coalesce,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Add PHY loopback test

2005-09-06 Thread Linux Kernel Mailing List
tree 39f80cdabbe7775fddc37490f4ae3609963e31d4
parent 4009a93d8e85f685b02794aee28e3272be862e2b
author Michael Chan [EMAIL PROTECTED] Tue, 06 Sep 2005 07:53:06 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:53:06 -0700

[TG3]: Add PHY loopback test

Improve ethtool loopback self test by adding PHY loopback to the
existing MAC loopback test.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/net/tg3.c |   73 +++---
 1 files changed, 53 insertions(+), 20 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7935,9 +7935,12 @@ static int tg3_test_memory(struct tg3 *t
return err;
 }
 
-static int tg3_test_loopback(struct tg3 *tp)
+#define TG3_MAC_LOOPBACK   0
+#define TG3_PHY_LOOPBACK   1
+
+static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
 {
-   u32 mac_mode, send_idx, rx_start_idx, rx_idx, tx_idx, opaque_key;
+   u32 mac_mode, rx_start_idx, rx_idx, tx_idx, opaque_key;
u32 desc_idx;
struct sk_buff *skb, *rx_skb;
u8 *tx_data;
@@ -7945,17 +7948,25 @@ static int tg3_test_loopback(struct tg3 
int num_pkts, tx_len, rx_len, i, err;
struct tg3_rx_buffer_desc *desc;
 
-   if (!netif_running(tp-dev))
-   return -ENODEV;
-
-   err = -EIO;
+   if (loopback_mode == TG3_MAC_LOOPBACK) {
+   mac_mode = (tp-mac_mode  ~MAC_MODE_PORT_MODE_MASK) |
+  MAC_MODE_PORT_INT_LPBACK | MAC_MODE_LINK_POLARITY |
+  MAC_MODE_PORT_MODE_GMII;
+   tw32(MAC_MODE, mac_mode);
+   } else if (loopback_mode == TG3_PHY_LOOPBACK) {
+   mac_mode = (tp-mac_mode  ~MAC_MODE_PORT_MODE_MASK) |
+  MAC_MODE_LINK_POLARITY | MAC_MODE_PORT_MODE_GMII;
+   if ((tp-phy_id  PHY_ID_MASK) == PHY_ID_BCM5401)
+   mac_mode = ~MAC_MODE_LINK_POLARITY;
+   tw32(MAC_MODE, mac_mode);
 
-   tg3_reset_hw(tp);
+   tg3_writephy(tp, MII_BMCR, BMCR_LOOPBACK | BMCR_FULLDPLX |
+  BMCR_SPEED1000);
+   }
+   else
+   return -EINVAL;
 
-   mac_mode = (tp-mac_mode  ~MAC_MODE_PORT_MODE_MASK) |
-  MAC_MODE_PORT_INT_LPBACK | MAC_MODE_LINK_POLARITY |
-  MAC_MODE_PORT_MODE_GMII;
-   tw32(MAC_MODE, mac_mode);
+   err = -EIO;
 
tx_len = 1514;
skb = dev_alloc_skb(tx_len);
@@ -7977,15 +7988,15 @@ static int tg3_test_loopback(struct tg3 
 
rx_start_idx = tp-hw_status-idx[0].rx_producer;
 
-   send_idx = 0;
num_pkts = 0;
 
-   tg3_set_txd(tp, send_idx, map, tx_len, 0, 1);
+   tg3_set_txd(tp, tp-tx_prod, map, tx_len, 0, 1);
 
-   send_idx++;
+   tp-tx_prod++;
num_pkts++;
 
-   tw32_tx_mbox(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW, send_idx);
+   tw32_tx_mbox(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW,
+tp-tx_prod);
tr32_mailbox(MAILBOX_SNDHOST_PROD_IDX_0 + TG3_64BIT_REG_LOW);
 
udelay(10);
@@ -7998,7 +8009,7 @@ static int tg3_test_loopback(struct tg3 
 
tx_idx = tp-hw_status-idx[0].tx_consumer;
rx_idx = tp-hw_status-idx[0].rx_producer;
-   if ((tx_idx == send_idx) 
+   if ((tx_idx == tp-tx_prod) 
(rx_idx == (rx_start_idx + num_pkts)))
break;
}
@@ -8006,7 +8017,7 @@ static int tg3_test_loopback(struct tg3 
pci_unmap_single(tp-pdev, map, tx_len, PCI_DMA_TODEVICE);
dev_kfree_skb(skb);
 
-   if (tx_idx != send_idx)
+   if (tx_idx != tp-tx_prod)
goto out;
 
if (rx_idx != rx_start_idx + num_pkts)
@@ -8042,6 +8053,30 @@ out:
return err;
 }
 
+#define TG3_MAC_LOOPBACK_FAILED1
+#define TG3_PHY_LOOPBACK_FAILED2
+#define TG3_LOOPBACK_FAILED(TG3_MAC_LOOPBACK_FAILED |  \
+TG3_PHY_LOOPBACK_FAILED)
+
+static int tg3_test_loopback(struct tg3 *tp)
+{
+   int err = 0;
+
+   if (!netif_running(tp-dev))
+   return TG3_LOOPBACK_FAILED;
+
+   tg3_reset_hw(tp);
+
+   if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
+   err |= TG3_MAC_LOOPBACK_FAILED;
+   if (!(tp-tg3_flags2  TG3_FLG2_PHY_SERDES)) {
+   if (tg3_run_loopback(tp, TG3_PHY_LOOPBACK))
+   err |= TG3_PHY_LOOPBACK_FAILED;
+   }
+
+   return err;
+}
+
 static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
  u64 *data)
 {
@@ -8082,10 +8117,8 @@ static void tg3_self_test(struct net_dev
etest-flags |= ETH_TEST_FL_FAILED;
data[3] = 1;
}
-   if 

[TG3]: Remove status block access in tg3_msi() and add prefetches

2005-09-06 Thread Linux Kernel Mailing List
tree 79f40bebd2062bfad707eb5f49087c100843a20a
parent 9f40dead25957434937f2b1872e9f4b43605f0ad
author Michael Chan [EMAIL PROTECTED] Tue, 06 Sep 2005 07:53:19 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:53:19 -0700

[TG3]: Remove status block access in tg3_msi() and add prefetches

Remove unnecessary status block accesses in tg3_msi(). Since MSI is
not shared, it is unnecessary to read the status block to determine if
there are any new events in the MSI handler. It is also unnecessary to
clear the updated bit in the status block.

Since the poll list is per-cpu, tg3_poll() will be scheduled to run on
the same CPU that received the MSI. Prefetches for the status block
and the next rx descriptors are added in tg3_msi() to improve their
access times when tg3_poll() runs.

In the non-MSI irq handlers, we need to check the status block because
interrupts may be shared. Only prefetches for the next rx descriptors
are added.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/net/tg3.c |   28 +++-
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -36,6 +36,7 @@
 #include linux/ip.h
 #include linux/tcp.h
 #include linux/workqueue.h
+#include linux/prefetch.h
 
 #include net/checksum.h
 
@@ -3278,8 +3279,9 @@ static irqreturn_t tg3_msi(int irq, void
 {
struct net_device *dev = dev_id;
struct tg3 *tp = netdev_priv(dev);
-   struct tg3_hw_status *sblk = tp-hw_status;
 
+   prefetch(tp-hw_status);
+   prefetch(tp-rx_rcb[tp-rx_rcb_ptr]);
/*
 * Writing any value to intr-mbox-0 clears PCI INTA# and
 * chip-internal interrupt pending events.
@@ -3288,19 +3290,9 @@ static irqreturn_t tg3_msi(int irq, void
 * event coalescing.
 */
tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x0001);
-   tp-last_tag = sblk-status_tag;
-   rmb();
-   if (tg3_irq_sync(tp))
-   goto out;
-   sblk-status = ~SD_STATUS_UPDATED;
-   if (likely(tg3_has_work(tp)))
+   if (likely(!tg3_irq_sync(tp)))
netif_rx_schedule(dev); /* schedule NAPI poll */
-   else {
-   /* No work, re-enable interrupts.  */
-   tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
-tp-last_tag  24);
-   }
-out:
+
return IRQ_RETVAL(1);
 }
 
@@ -3330,9 +3322,10 @@ static irqreturn_t tg3_interrupt(int irq
if (tg3_irq_sync(tp))
goto out;
sblk-status = ~SD_STATUS_UPDATED;
-   if (likely(tg3_has_work(tp)))
+   if (likely(tg3_has_work(tp))) {
+   prefetch(tp-rx_rcb[tp-rx_rcb_ptr]);
netif_rx_schedule(dev); /* schedule NAPI poll */
-   else {
+   } else {
/* No work, shared interrupt perhaps?  re-enable
 * interrupts, and flush that PCI write
 */
@@ -3374,9 +3367,10 @@ static irqreturn_t tg3_interrupt_tagged(
if (tg3_irq_sync(tp))
goto out;
sblk-status = ~SD_STATUS_UPDATED;
-   if (likely(tg3_has_work(tp)))
+   if (likely(tg3_has_work(tp))) {
+   prefetch(tp-rx_rcb[tp-rx_rcb_ptr]);
netif_rx_schedule(dev); /* schedule NAPI poll */
-   else {
+   } else {
/* no work, shared interrupt perhaps?  re-enable
 * interrupts, and flush that PCI write
 */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Use status tag to check for new events

2005-09-06 Thread Linux Kernel Mailing List
tree b3e1a3a714db10d8d7f6f083659e67fe193487b7
parent 61487480dd79acc5e82b08cd29cbcbd3301645fa
author Michael Chan [EMAIL PROTECTED] Tue, 06 Sep 2005 07:53:32 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:53:32 -0700

[TG3]: Use status tag to check for new events

Use the status tag to determine if there are new events in
tg3_interrupt_tagged(). We discussed about this a while ago with Grant
Grundler and DaveM. This scheme makes it unnecessary to clear the
updated bit in the status block when using tagged mode, and only
a simple comparison is needed to determine if there are new events.

The tp-lock around netif_rx_complete() and tg3_restart_ints() is also
removed. It is unnecessary with DaveM's new locking scheme.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/net/tg3.c |   32 +++-
 1 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -488,7 +488,8 @@ static void tg3_disable_ints(struct tg3 
 
 static inline void tg3_cond_int(struct tg3 *tp)
 {
-   if (tp-hw_status-status  SD_STATUS_UPDATED)
+   if (!(tp-tg3_flags  TG3_FLAG_TAGGED_STATUS) 
+   (tp-hw_status-status  SD_STATUS_UPDATED))
tw32(GRC_LOCAL_CTRL, tp-grc_local_ctrl | GRC_LCLCTRL_SETINT);
 }
 
@@ -3220,18 +3221,17 @@ static int tg3_poll(struct net_device *n
netdev-quota -= work_done;
}
 
-   if (tp-tg3_flags  TG3_FLAG_TAGGED_STATUS)
+   if (tp-tg3_flags  TG3_FLAG_TAGGED_STATUS) {
tp-last_tag = sblk-status_tag;
-   rmb();
-   sblk-status = ~SD_STATUS_UPDATED;
+   rmb();
+   } else
+   sblk-status = ~SD_STATUS_UPDATED;
 
/* if no more work, tell net stack and NIC we're done */
done = !tg3_has_work(tp);
if (done) {
-   spin_lock(tp-lock);
netif_rx_complete(netdev);
tg3_restart_ints(tp);
-   spin_unlock(tp-lock);
}
 
return (done ? 0 : 1);
@@ -3351,7 +3351,7 @@ static irqreturn_t tg3_interrupt_tagged(
 * Reading the PCI State register will confirm whether the
 * interrupt is ours and will flush the status block.
 */
-   if ((sblk-status  SD_STATUS_UPDATED) ||
+   if ((sblk-status_tag != tp-last_tag) ||
!(tr32(TG3PCI_PCISTATE)  PCISTATE_INT_NOT_ACTIVE)) {
/*
 * writing any value to intr-mbox-0 clears PCI INTA# and
@@ -3362,20 +3362,17 @@ static irqreturn_t tg3_interrupt_tagged(
 */
tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
 0x0001);
-   tp-last_tag = sblk-status_tag;
-   rmb();
if (tg3_irq_sync(tp))
goto out;
-   sblk-status = ~SD_STATUS_UPDATED;
-   if (likely(tg3_has_work(tp))) {
+   if (netif_rx_schedule_prep(dev)) {
prefetch(tp-rx_rcb[tp-rx_rcb_ptr]);
-   netif_rx_schedule(dev); /* schedule NAPI poll */
-   } else {
-   /* no work, shared interrupt perhaps?  re-enable
-* interrupts, and flush that PCI write
+   /* Update last_tag to mark that this status has been
+* seen. Because interrupt may be shared, we may be
+* racing with tg3_poll(), so only update last_tag
+* if tg3_poll() is not scheduled.
 */
-   tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW,
-  tp-last_tag  24);
+   tp-last_tag = sblk-status_tag;
+   __netif_rx_schedule(dev);
}
} else {/* shared interrupt */
handled = 0;
@@ -6238,6 +6235,7 @@ static int tg3_test_interrupt(struct tg3
if (err)
return err;
 
+   tp-hw_status-status = ~SD_STATUS_UPDATED;
tg3_enable_ints(tp);
 
tw32_f(HOSTCC_MODE, tp-coalesce_mode | HOSTCC_MODE_ENABLE |
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Update driver version and release date.

2005-09-06 Thread Linux Kernel Mailing List
tree ce99103b1c0729e68c8e86b6a06dce6d123c8bc8
parent 38f3843ed6bdbcff9465386c3539523466880320
author David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:56:11 -0700
committer David S. Miller [EMAIL PROTECTED] Tue, 06 Sep 2005 07:56:11 -0700

[TG3]: Update driver version and release date.

Signed-off-by: David S. Miller [EMAIL PROTECTED]

 drivers/net/tg3.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -67,8 +67,8 @@
 
 #define DRV_MODULE_NAMEtg3
 #define PFX DRV_MODULE_NAME: 
-#define DRV_MODULE_VERSION 3.38
-#define DRV_MODULE_RELDATE September 1, 2005
+#define DRV_MODULE_VERSION 3.39
+#define DRV_MODULE_RELDATE September 5, 2005
 
 #define TG3_DEF_MAC_MODE   0
 #define TG3_DEF_RX_MODE0
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >