aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/boards.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 02:14:15 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 02:14:15 -0400
commit478c6a43fcbc6c11609f8cee7c7b57223907754f (patch)
treea7f7952099da60d33032aed6de9c0c56c9f8779e /drivers/net/sfc/boards.c
parent8a3f257c704e02aee9869decd069a806b45be3f1 (diff)
parent6bb597507f9839b13498781e481f5458aea33620 (diff)
Merge branch 'linus' into release
Conflicts: arch/x86/kernel/cpu/cpufreq/longhaul.c Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/net/sfc/boards.c')
-rw-r--r--drivers/net/sfc/boards.c74
1 files changed, 67 insertions, 7 deletions
diff --git a/drivers/net/sfc/boards.c b/drivers/net/sfc/boards.c
index 64903496aa9a..5182ac5a1034 100644
--- a/drivers/net/sfc/boards.c
+++ b/drivers/net/sfc/boards.c
@@ -26,7 +26,7 @@ static void blink_led_timer(unsigned long context)
26{ 26{
27 struct efx_nic *efx = (struct efx_nic *)context; 27 struct efx_nic *efx = (struct efx_nic *)context;
28 struct efx_blinker *bl = &efx->board_info.blinker; 28 struct efx_blinker *bl = &efx->board_info.blinker;
29 efx->board_info.set_fault_led(efx, bl->state); 29 efx->board_info.set_id_led(efx, bl->state);
30 bl->state = !bl->state; 30 bl->state = !bl->state;
31 if (bl->resubmit) 31 if (bl->resubmit)
32 mod_timer(&bl->timer, jiffies + BLINK_INTERVAL); 32 mod_timer(&bl->timer, jiffies + BLINK_INTERVAL);
@@ -48,7 +48,7 @@ static void board_blink(struct efx_nic *efx, bool blink)
48 blinker->resubmit = false; 48 blinker->resubmit = false;
49 if (blinker->timer.function) 49 if (blinker->timer.function)
50 del_timer_sync(&blinker->timer); 50 del_timer_sync(&blinker->timer);
51 efx->board_info.set_fault_led(efx, false); 51 efx->board_info.init_leds(efx);
52 } 52 }
53} 53}
54 54
@@ -185,7 +185,7 @@ static struct i2c_board_info sfe4002_hwmon_info = {
185#define SFE4002_RX_LED (0) /* Green */ 185#define SFE4002_RX_LED (0) /* Green */
186#define SFE4002_TX_LED (1) /* Amber */ 186#define SFE4002_TX_LED (1) /* Amber */
187 187
188static int sfe4002_init_leds(struct efx_nic *efx) 188static void sfe4002_init_leds(struct efx_nic *efx)
189{ 189{
190 /* Set the TX and RX LEDs to reflect status and activity, and the 190 /* Set the TX and RX LEDs to reflect status and activity, and the
191 * fault LED off */ 191 * fault LED off */
@@ -194,11 +194,9 @@ static int sfe4002_init_leds(struct efx_nic *efx)
194 xfp_set_led(efx, SFE4002_RX_LED, 194 xfp_set_led(efx, SFE4002_RX_LED,
195 QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACTSTAT); 195 QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACTSTAT);
196 xfp_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF); 196 xfp_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF);
197 efx->board_info.blinker.led_num = SFE4002_FAULT_LED;
198 return 0;
199} 197}
200 198
201static void sfe4002_fault_led(struct efx_nic *efx, bool state) 199static void sfe4002_set_id_led(struct efx_nic *efx, bool state)
202{ 200{
203 xfp_set_led(efx, SFE4002_FAULT_LED, state ? QUAKE_LED_ON : 201 xfp_set_led(efx, SFE4002_FAULT_LED, state ? QUAKE_LED_ON :
204 QUAKE_LED_OFF); 202 QUAKE_LED_OFF);
@@ -222,7 +220,67 @@ static int sfe4002_init(struct efx_nic *efx)
222 return rc; 220 return rc;
223 efx->board_info.monitor = sfe4002_check_hw; 221 efx->board_info.monitor = sfe4002_check_hw;
224 efx->board_info.init_leds = sfe4002_init_leds; 222 efx->board_info.init_leds = sfe4002_init_leds;
225 efx->board_info.set_fault_led = sfe4002_fault_led; 223 efx->board_info.set_id_led = sfe4002_set_id_led;
224 efx->board_info.blink = board_blink;
225 efx->board_info.fini = efx_fini_lm87;
226 return 0;
227}
228
229/*****************************************************************************
230 * Support for the SFN4112F
231 *
232 */
233static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */
234
235static const u8 sfn4112f_lm87_regs[] = {
236 LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */
237 LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */
238 LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */
239 LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */
240 LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */
241 LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */
242 LM87_TEMP_INT_LIMITS(10, 60), /* board */
243 LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */
244 0
245};
246
247static struct i2c_board_info sfn4112f_hwmon_info = {
248 I2C_BOARD_INFO("lm87", 0x2e),
249 .platform_data = &sfn4112f_lm87_channel,
250 .irq = -1,
251};
252
253#define SFN4112F_ACT_LED 0
254#define SFN4112F_LINK_LED 1
255
256static void sfn4112f_init_leds(struct efx_nic *efx)
257{
258 xfp_set_led(efx, SFN4112F_ACT_LED,
259 QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACT);
260 xfp_set_led(efx, SFN4112F_LINK_LED,
261 QUAKE_LED_RXLINK | QUAKE_LED_LINK_STAT);
262}
263
264static void sfn4112f_set_id_led(struct efx_nic *efx, bool state)
265{
266 xfp_set_led(efx, SFN4112F_LINK_LED,
267 state ? QUAKE_LED_ON : QUAKE_LED_OFF);
268}
269
270static int sfn4112f_check_hw(struct efx_nic *efx)
271{
272 /* Mask out unused sensors */
273 return efx_check_lm87(efx, ~0x48);
274}
275
276static int sfn4112f_init(struct efx_nic *efx)
277{
278 int rc = efx_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs);
279 if (rc)
280 return rc;
281 efx->board_info.monitor = sfn4112f_check_hw;
282 efx->board_info.init_leds = sfn4112f_init_leds;
283 efx->board_info.set_id_led = sfn4112f_set_id_led;
226 efx->board_info.blink = board_blink; 284 efx->board_info.blink = board_blink;
227 efx->board_info.fini = efx_fini_lm87; 285 efx->board_info.fini = efx_fini_lm87;
228 return 0; 286 return 0;
@@ -243,6 +301,8 @@ static struct efx_board_data board_data[] = {
243 { EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init }, 301 { EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
244 { EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter", 302 { EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
245 sfn4111t_init }, 303 sfn4111t_init },
304 { EFX_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
305 sfn4112f_init },
246}; 306};
247 307
248void efx_set_board_info(struct efx_nic *efx, u16 revision_info) 308void efx_set_board_info(struct efx_nic *efx, u16 revision_info)