Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | * Driver for Solarflare Solarstorm network controllers and boards |
| 3 | * Copyright 2007 Solarflare Communications Inc. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 as published |
| 7 | * by the Free Software Foundation, incorporated herein by reference. |
| 8 | */ |
| 9 | |
| 10 | /***************************************************************************** |
| 11 | * Support for the SFE4001 NIC: driver code for the PCA9539 I/O expander that |
| 12 | * controls the PHY power rails, and for the MAX6647 temp. sensor used to check |
| 13 | * the PHY |
| 14 | */ |
| 15 | #include <linux/delay.h> |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 16 | #include "net_driver.h" |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 17 | #include "efx.h" |
| 18 | #include "phy.h" |
| 19 | #include "boards.h" |
| 20 | #include "falcon.h" |
| 21 | #include "falcon_hwdefs.h" |
Ben Hutchings | c1e5fcc | 2008-09-01 12:48:41 +0100 | [diff] [blame] | 22 | #include "falcon_io.h" |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 23 | #include "mac.h" |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 24 | #include "workarounds.h" |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 25 | |
| 26 | /************************************************************************** |
| 27 | * |
| 28 | * I2C IO Expander device |
| 29 | * |
| 30 | **************************************************************************/ |
| 31 | #define PCA9539 0x74 |
| 32 | |
| 33 | #define P0_IN 0x00 |
| 34 | #define P0_OUT 0x02 |
| 35 | #define P0_INVERT 0x04 |
| 36 | #define P0_CONFIG 0x06 |
| 37 | |
| 38 | #define P0_EN_1V0X_LBN 0 |
| 39 | #define P0_EN_1V0X_WIDTH 1 |
| 40 | #define P0_EN_1V2_LBN 1 |
| 41 | #define P0_EN_1V2_WIDTH 1 |
| 42 | #define P0_EN_2V5_LBN 2 |
| 43 | #define P0_EN_2V5_WIDTH 1 |
| 44 | #define P0_EN_3V3X_LBN 3 |
| 45 | #define P0_EN_3V3X_WIDTH 1 |
| 46 | #define P0_EN_5V_LBN 4 |
| 47 | #define P0_EN_5V_WIDTH 1 |
| 48 | #define P0_SHORTEN_JTAG_LBN 5 |
| 49 | #define P0_SHORTEN_JTAG_WIDTH 1 |
| 50 | #define P0_X_TRST_LBN 6 |
| 51 | #define P0_X_TRST_WIDTH 1 |
| 52 | #define P0_DSP_RESET_LBN 7 |
| 53 | #define P0_DSP_RESET_WIDTH 1 |
| 54 | |
| 55 | #define P1_IN 0x01 |
| 56 | #define P1_OUT 0x03 |
| 57 | #define P1_INVERT 0x05 |
| 58 | #define P1_CONFIG 0x07 |
| 59 | |
| 60 | #define P1_AFE_PWD_LBN 0 |
| 61 | #define P1_AFE_PWD_WIDTH 1 |
| 62 | #define P1_DSP_PWD25_LBN 1 |
| 63 | #define P1_DSP_PWD25_WIDTH 1 |
| 64 | #define P1_RESERVED_LBN 2 |
| 65 | #define P1_RESERVED_WIDTH 2 |
| 66 | #define P1_SPARE_LBN 4 |
| 67 | #define P1_SPARE_WIDTH 4 |
| 68 | |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 69 | /* Temperature Sensor */ |
| 70 | #define MAX664X_REG_RSL 0x02 |
| 71 | #define MAX664X_REG_WLHO 0x0B |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 72 | |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 73 | static void sfe4001_poweroff(struct efx_nic *efx) |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 74 | { |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 75 | struct i2c_client *ioexp_client = efx->board_info.ioexp_client; |
| 76 | struct i2c_client *hwmon_client = efx->board_info.hwmon_client; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 77 | |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 78 | /* Turn off all power rails and disable outputs */ |
| 79 | i2c_smbus_write_byte_data(ioexp_client, P0_OUT, 0xff); |
| 80 | i2c_smbus_write_byte_data(ioexp_client, P1_CONFIG, 0xff); |
| 81 | i2c_smbus_write_byte_data(ioexp_client, P0_CONFIG, 0xff); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 82 | |
| 83 | /* Clear any over-temperature alert */ |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 84 | i2c_smbus_read_byte_data(hwmon_client, MAX664X_REG_RSL); |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 85 | } |
| 86 | |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 87 | static int sfe4001_poweron(struct efx_nic *efx) |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 88 | { |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 89 | struct i2c_client *hwmon_client = efx->board_info.hwmon_client; |
| 90 | struct i2c_client *ioexp_client = efx->board_info.ioexp_client; |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 91 | unsigned int i, j; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 92 | int rc; |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 93 | u8 out; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 94 | |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 95 | /* Clear any previous over-temperature alert */ |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 96 | rc = i2c_smbus_read_byte_data(hwmon_client, MAX664X_REG_RSL); |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 97 | if (rc < 0) |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 98 | return rc; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 99 | |
| 100 | /* Enable port 0 and port 1 outputs on IO expander */ |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 101 | rc = i2c_smbus_write_byte_data(ioexp_client, P0_CONFIG, 0x00); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 102 | if (rc) |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 103 | return rc; |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 104 | rc = i2c_smbus_write_byte_data(ioexp_client, P1_CONFIG, |
| 105 | 0xff & ~(1 << P1_SPARE_LBN)); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 106 | if (rc) |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 107 | goto fail_on; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 108 | |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 109 | /* If PHY power is on, turn it all off and wait 1 second to |
| 110 | * ensure a full reset. |
| 111 | */ |
| 112 | rc = i2c_smbus_read_byte_data(ioexp_client, P0_OUT); |
| 113 | if (rc < 0) |
| 114 | goto fail_on; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 115 | out = 0xff & ~((0 << P0_EN_1V2_LBN) | (0 << P0_EN_2V5_LBN) | |
| 116 | (0 << P0_EN_3V3X_LBN) | (0 << P0_EN_5V_LBN) | |
| 117 | (0 << P0_EN_1V0X_LBN)); |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 118 | if (rc != out) { |
| 119 | EFX_INFO(efx, "power-cycling PHY\n"); |
| 120 | rc = i2c_smbus_write_byte_data(ioexp_client, P0_OUT, out); |
| 121 | if (rc) |
| 122 | goto fail_on; |
| 123 | schedule_timeout_uninterruptible(HZ); |
| 124 | } |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 125 | |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 126 | for (i = 0; i < 20; ++i) { |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 127 | /* Turn on 1.2V, 2.5V, 3.3V and 5V power rails */ |
| 128 | out = 0xff & ~((1 << P0_EN_1V2_LBN) | (1 << P0_EN_2V5_LBN) | |
| 129 | (1 << P0_EN_3V3X_LBN) | (1 << P0_EN_5V_LBN) | |
| 130 | (1 << P0_X_TRST_LBN)); |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 131 | if (efx->phy_mode & PHY_MODE_SPECIAL) |
Ben Hutchings | 75f2d3e | 2008-05-07 12:55:13 +0100 | [diff] [blame] | 132 | out |= 1 << P0_EN_3V3X_LBN; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 133 | |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 134 | rc = i2c_smbus_write_byte_data(ioexp_client, P0_OUT, out); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 135 | if (rc) |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 136 | goto fail_on; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 137 | msleep(10); |
| 138 | |
| 139 | /* Turn on 1V power rail */ |
| 140 | out &= ~(1 << P0_EN_1V0X_LBN); |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 141 | rc = i2c_smbus_write_byte_data(ioexp_client, P0_OUT, out); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 142 | if (rc) |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 143 | goto fail_on; |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 144 | |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 145 | EFX_INFO(efx, "waiting for DSP boot (attempt %d)...\n", i); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 146 | |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 147 | /* In flash config mode, DSP does not turn on AFE, so |
| 148 | * just wait 1 second. |
| 149 | */ |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 150 | if (efx->phy_mode & PHY_MODE_SPECIAL) { |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 151 | schedule_timeout_uninterruptible(HZ); |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 152 | return 0; |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 153 | } |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 154 | |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 155 | for (j = 0; j < 10; ++j) { |
| 156 | msleep(100); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 157 | |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 158 | /* Check DSP has asserted AFE power line */ |
| 159 | rc = i2c_smbus_read_byte_data(ioexp_client, P1_IN); |
| 160 | if (rc < 0) |
| 161 | goto fail_on; |
| 162 | if (rc & (1 << P1_AFE_PWD_LBN)) |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 163 | return 0; |
Ben Hutchings | 11f34e6 | 2008-09-01 12:45:48 +0100 | [diff] [blame] | 164 | } |
| 165 | } |
| 166 | |
| 167 | EFX_INFO(efx, "timed out waiting for DSP boot\n"); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 168 | rc = -ETIMEDOUT; |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 169 | fail_on: |
| 170 | sfe4001_poweroff(efx); |
| 171 | return rc; |
| 172 | } |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 173 | |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 174 | static int sfe4001_check_hw(struct efx_nic *efx) |
| 175 | { |
| 176 | s32 status; |
| 177 | |
| 178 | /* If XAUI link is up then do not monitor */ |
Ben Hutchings | 177dfcd | 2008-12-12 21:50:08 -0800 | [diff] [blame] | 179 | if (EFX_WORKAROUND_7884(efx) && efx->mac_up) |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 180 | return 0; |
| 181 | |
| 182 | /* Check the powered status of the PHY. Lack of power implies that |
| 183 | * the MAX6647 has shut down power to it, probably due to a temp. |
| 184 | * alarm. Reading the power status rather than the MAX6647 status |
| 185 | * directly because the later is read-to-clear and would thus |
| 186 | * start to power up the PHY again when polled, causing us to blip |
| 187 | * the power undesirably. |
| 188 | * We know we can read from the IO expander because we did |
| 189 | * it during power-on. Assume failure now is bad news. */ |
| 190 | status = i2c_smbus_read_byte_data(efx->board_info.ioexp_client, P1_IN); |
| 191 | if (status >= 0 && |
| 192 | (status & ((1 << P1_AFE_PWD_LBN) | (1 << P1_DSP_PWD25_LBN))) != 0) |
| 193 | return 0; |
| 194 | |
| 195 | /* Use board power control, not PHY power control */ |
| 196 | sfe4001_poweroff(efx); |
| 197 | efx->phy_mode = PHY_MODE_OFF; |
| 198 | |
| 199 | return (status < 0) ? -EIO : -ERANGE; |
| 200 | } |
| 201 | |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 202 | /* On SFE4001 rev A2 and later, we can control the FLASH_CFG_1 pin |
| 203 | * using the 3V3X output of the IO-expander. Allow the user to set |
| 204 | * this when the device is stopped, and keep it stopped then. |
| 205 | */ |
| 206 | |
| 207 | static ssize_t show_phy_flash_cfg(struct device *dev, |
| 208 | struct device_attribute *attr, char *buf) |
| 209 | { |
| 210 | struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev)); |
| 211 | return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL)); |
| 212 | } |
| 213 | |
| 214 | static ssize_t set_phy_flash_cfg(struct device *dev, |
| 215 | struct device_attribute *attr, |
| 216 | const char *buf, size_t count) |
| 217 | { |
| 218 | struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev)); |
| 219 | enum efx_phy_mode old_mode, new_mode; |
| 220 | int err; |
| 221 | |
| 222 | rtnl_lock(); |
| 223 | old_mode = efx->phy_mode; |
| 224 | if (count == 0 || *buf == '0') |
| 225 | new_mode = old_mode & ~PHY_MODE_SPECIAL; |
| 226 | else |
| 227 | new_mode = PHY_MODE_SPECIAL; |
| 228 | if (old_mode == new_mode) { |
| 229 | err = 0; |
| 230 | } else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) { |
| 231 | err = -EBUSY; |
| 232 | } else { |
| 233 | efx->phy_mode = new_mode; |
| 234 | err = sfe4001_poweron(efx); |
| 235 | efx_reconfigure_port(efx); |
| 236 | } |
| 237 | rtnl_unlock(); |
| 238 | |
| 239 | return err ? err : count; |
| 240 | } |
| 241 | |
| 242 | static DEVICE_ATTR(phy_flash_cfg, 0644, show_phy_flash_cfg, set_phy_flash_cfg); |
| 243 | |
| 244 | static void sfe4001_fini(struct efx_nic *efx) |
| 245 | { |
| 246 | EFX_INFO(efx, "%s\n", __func__); |
| 247 | |
| 248 | device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); |
| 249 | sfe4001_poweroff(efx); |
| 250 | i2c_unregister_device(efx->board_info.ioexp_client); |
| 251 | i2c_unregister_device(efx->board_info.hwmon_client); |
| 252 | } |
| 253 | |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 254 | static struct i2c_board_info sfe4001_hwmon_info = { |
| 255 | I2C_BOARD_INFO("max6647", 0x4e), |
| 256 | .irq = -1, |
| 257 | }; |
| 258 | |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 259 | /* This board uses an I2C expander to provider power to the PHY, which needs to |
| 260 | * be turned on before the PHY can be used. |
| 261 | * Context: Process context, rtnl lock held |
| 262 | */ |
| 263 | int sfe4001_init(struct efx_nic *efx) |
| 264 | { |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 265 | int rc; |
| 266 | |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 267 | #if defined(CONFIG_SENSORS_LM90) || defined(CONFIG_SENSORS_LM90_MODULE) |
| 268 | efx->board_info.hwmon_client = |
| 269 | i2c_new_device(&efx->i2c_adap, &sfe4001_hwmon_info); |
| 270 | #else |
| 271 | efx->board_info.hwmon_client = |
| 272 | i2c_new_dummy(&efx->i2c_adap, sfe4001_hwmon_info.addr); |
| 273 | #endif |
| 274 | if (!efx->board_info.hwmon_client) |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 275 | return -EIO; |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 276 | |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 277 | /* Raise board/PHY high limit from 85 to 90 degrees Celsius */ |
| 278 | rc = i2c_smbus_write_byte_data(efx->board_info.hwmon_client, |
| 279 | MAX664X_REG_WLHO, 90); |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 280 | if (rc) |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 281 | goto fail_hwmon; |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 282 | |
| 283 | efx->board_info.ioexp_client = i2c_new_dummy(&efx->i2c_adap, PCA9539); |
| 284 | if (!efx->board_info.ioexp_client) { |
| 285 | rc = -EIO; |
| 286 | goto fail_hwmon; |
| 287 | } |
| 288 | |
| 289 | /* 10Xpress has fixed-function LED pins, so there is no board-specific |
| 290 | * blink code. */ |
| 291 | efx->board_info.blink = tenxpress_phy_blink; |
| 292 | |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 293 | efx->board_info.monitor = sfe4001_check_hw; |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 294 | efx->board_info.fini = sfe4001_fini; |
| 295 | |
| 296 | rc = sfe4001_poweron(efx); |
| 297 | if (rc) |
| 298 | goto fail_ioexp; |
| 299 | |
| 300 | rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); |
| 301 | if (rc) |
| 302 | goto fail_on; |
| 303 | |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 304 | EFX_INFO(efx, "PHY is powered on\n"); |
| 305 | return 0; |
| 306 | |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 307 | fail_on: |
| 308 | sfe4001_poweroff(efx); |
| 309 | fail_ioexp: |
Ben Hutchings | f8b87c1 | 2008-09-01 12:48:17 +0100 | [diff] [blame] | 310 | i2c_unregister_device(efx->board_info.ioexp_client); |
Ben Hutchings | 37b5a60 | 2008-05-30 22:27:04 +0100 | [diff] [blame] | 311 | fail_hwmon: |
Ben Hutchings | 3e133c4 | 2008-11-04 20:34:56 +0000 | [diff] [blame] | 312 | i2c_unregister_device(efx->board_info.hwmon_client); |
Ben Hutchings | 8ceee66 | 2008-04-27 12:55:59 +0100 | [diff] [blame] | 313 | return rc; |
| 314 | } |