diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-23 00:47:29 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-07-23 00:47:29 -0400 |
commit | bd072111e7319d90a7b8127f91c2806b9a6f279e (patch) | |
tree | 1686978814a2387ebfc16f9f5778a7f0caaf319b /include/linux/mfd/asic3.h | |
parent | 24d01c0681bfbc10a99304c48a89ad213d2d7a4b (diff) | |
parent | 4be3bd7849165e7efa6b0b35a23d6a3598d97465 (diff) |
Merge commit 'v2.6.31-rc4' into next
Diffstat (limited to 'include/linux/mfd/asic3.h')
-rw-r--r-- | include/linux/mfd/asic3.h | 236 |
1 files changed, 15 insertions, 221 deletions
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h index 322cd6deb9f0..de3c4ad19afb 100644 --- a/include/linux/mfd/asic3.h +++ b/include/linux/mfd/asic3.h | |||
@@ -30,6 +30,13 @@ struct asic3_platform_data { | |||
30 | #define ASIC3_NUM_GPIOS 64 | 30 | #define ASIC3_NUM_GPIOS 64 |
31 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 | 31 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 |
32 | 32 | ||
33 | #define ASIC3_IRQ_LED0 64 | ||
34 | #define ASIC3_IRQ_LED1 65 | ||
35 | #define ASIC3_IRQ_LED2 66 | ||
36 | #define ASIC3_IRQ_SPI 67 | ||
37 | #define ASIC3_IRQ_SMBUS 68 | ||
38 | #define ASIC3_IRQ_OWM 69 | ||
39 | |||
33 | #define ASIC3_TO_GPIO(gpio) (NR_BUILTIN_GPIO + (gpio)) | 40 | #define ASIC3_TO_GPIO(gpio) (NR_BUILTIN_GPIO + (gpio)) |
34 | 41 | ||
35 | #define ASIC3_GPIO_BANK_A 0 | 42 | #define ASIC3_GPIO_BANK_A 0 |
@@ -227,8 +234,8 @@ struct asic3_platform_data { | |||
227 | 234 | ||
228 | 235 | ||
229 | /* Basic control of the SD ASIC */ | 236 | /* Basic control of the SD ASIC */ |
230 | #define ASIC3_SDHWCTRL_Base 0x0E00 | 237 | #define ASIC3_SDHWCTRL_BASE 0x0E00 |
231 | #define ASIC3_SDHWCTRL_SDConf 0x00 | 238 | #define ASIC3_SDHWCTRL_SDCONF 0x00 |
232 | 239 | ||
233 | #define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ | 240 | #define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ |
234 | #define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ | 241 | #define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ |
@@ -242,10 +249,10 @@ struct asic3_platform_data { | |||
242 | /* SD card power supply ctrl 1=enable */ | 249 | /* SD card power supply ctrl 1=enable */ |
243 | #define ASIC3_SDHWCTRL_SDPWR (1 << 6) | 250 | #define ASIC3_SDHWCTRL_SDPWR (1 << 6) |
244 | 251 | ||
245 | #define ASIC3_EXTCF_Base 0x1100 | 252 | #define ASIC3_EXTCF_BASE 0x1100 |
246 | 253 | ||
247 | #define ASIC3_EXTCF_Select 0x00 | 254 | #define ASIC3_EXTCF_SELECT 0x00 |
248 | #define ASIC3_EXTCF_Reset 0x04 | 255 | #define ASIC3_EXTCF_RESET 0x04 |
249 | 256 | ||
250 | #define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ | 257 | #define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ |
251 | #define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ | 258 | #define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ |
@@ -279,222 +286,9 @@ struct asic3_platform_data { | |||
279 | * SDIO_CTRL Control registers for SDIO operations | 286 | * SDIO_CTRL Control registers for SDIO operations |
280 | * | 287 | * |
281 | *****************************************************************************/ | 288 | *****************************************************************************/ |
282 | #define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */ | 289 | #define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ |
283 | 290 | #define ASIC3_SD_CTRL_BASE 0x1000 | |
284 | #define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */ | 291 | #define ASIC3_SDIO_CTRL_BASE 0x1200 |
285 | |||
286 | /* [0:8] SD Control Register Base Address */ | ||
287 | #define ASIC3_SD_CONFIG_Addr0 0x20 | ||
288 | |||
289 | /* [9:31] SD Control Register Base Address */ | ||
290 | #define ASIC3_SD_CONFIG_Addr1 0x24 | ||
291 | |||
292 | /* R/O: interrupt assigned to pin */ | ||
293 | #define ASIC3_SD_CONFIG_IntPin 0x78 | ||
294 | |||
295 | /* | ||
296 | * Set to 0x1f to clock SD controller, 0 otherwise. | ||
297 | * At 0x82 - Gated Clock Ctrl | ||
298 | */ | ||
299 | #define ASIC3_SD_CONFIG_ClkStop 0x80 | ||
300 | |||
301 | /* Control clock of SD controller */ | ||
302 | #define ASIC3_SD_CONFIG_ClockMode 0x84 | ||
303 | #define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */ | ||
304 | #define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */ | ||
305 | |||
306 | /* auto power up after card inserted */ | ||
307 | #define ASIC3_SD_CONFIG_SDHC_Power2 0x92 | ||
308 | |||
309 | /* auto power down when card removed */ | ||
310 | #define ASIC3_SD_CONFIG_SDHC_Power3 0x94 | ||
311 | #define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98 | ||
312 | #define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */ | ||
313 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */ | ||
314 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/ | ||
315 | |||
316 | /* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */ | ||
317 | #define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8 | ||
318 | #define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */ | ||
319 | |||
320 | /* Bit 1: double buffer/single buffer */ | ||
321 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0 | ||
322 | |||
323 | /* Memory access enable (set to 1 to access SD Controller) */ | ||
324 | #define SD_CONFIG_COMMAND_MAE (1<<1) | ||
325 | |||
326 | #define SD_CONFIG_CLK_ENABLE_ALL 0x1f | ||
327 | |||
328 | #define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */ | ||
329 | #define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */ | ||
330 | |||
331 | /* two bits - number of cycles for card detection */ | ||
332 | #define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3) | ||
333 | |||
334 | |||
335 | #define ASIC3_SD_CTRL_Base 0x1000 | ||
336 | |||
337 | #define ASIC3_SD_CTRL_Cmd 0x00 | ||
338 | #define ASIC3_SD_CTRL_Arg0 0x08 | ||
339 | #define ASIC3_SD_CTRL_Arg1 0x0C | ||
340 | #define ASIC3_SD_CTRL_StopInternal 0x10 | ||
341 | #define ASIC3_SD_CTRL_TransferSectorCount 0x14 | ||
342 | #define ASIC3_SD_CTRL_Response0 0x18 | ||
343 | #define ASIC3_SD_CTRL_Response1 0x1C | ||
344 | #define ASIC3_SD_CTRL_Response2 0x20 | ||
345 | #define ASIC3_SD_CTRL_Response3 0x24 | ||
346 | #define ASIC3_SD_CTRL_Response4 0x28 | ||
347 | #define ASIC3_SD_CTRL_Response5 0x2C | ||
348 | #define ASIC3_SD_CTRL_Response6 0x30 | ||
349 | #define ASIC3_SD_CTRL_Response7 0x34 | ||
350 | #define ASIC3_SD_CTRL_CardStatus 0x38 | ||
351 | #define ASIC3_SD_CTRL_BufferCtrl 0x3C | ||
352 | #define ASIC3_SD_CTRL_IntMaskCard 0x40 | ||
353 | #define ASIC3_SD_CTRL_IntMaskBuffer 0x44 | ||
354 | #define ASIC3_SD_CTRL_CardClockCtrl 0x48 | ||
355 | #define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C | ||
356 | #define ASIC3_SD_CTRL_MemCardOptionSetup 0x50 | ||
357 | #define ASIC3_SD_CTRL_ErrorStatus0 0x58 | ||
358 | #define ASIC3_SD_CTRL_ErrorStatus1 0x5C | ||
359 | #define ASIC3_SD_CTRL_DataPort 0x60 | ||
360 | #define ASIC3_SD_CTRL_TransactionCtrl 0x68 | ||
361 | #define ASIC3_SD_CTRL_SoftwareReset 0x1C0 | ||
362 | |||
363 | #define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0) | ||
364 | |||
365 | #define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8) | ||
366 | |||
367 | #define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15) | ||
368 | #define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8) | ||
369 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7) | ||
370 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6) | ||
371 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5) | ||
372 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4) | ||
373 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3) | ||
374 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2) | ||
375 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1) | ||
376 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0) | ||
377 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0) | ||
378 | |||
379 | #define MEM_CARD_OPTION_REQUIRED 0x000e | ||
380 | #define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4) | ||
381 | #define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14) | ||
382 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15) | ||
383 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0 | ||
384 | |||
385 | #define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f) | ||
386 | #define SD_CTRL_COMMAND_TYPE_CMD (0 << 6) | ||
387 | #define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6) | ||
388 | #define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6) | ||
389 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8) | ||
390 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8) | ||
391 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8) | ||
392 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8) | ||
393 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8) | ||
394 | #define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11) | ||
395 | #define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12) | ||
396 | #define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12) | ||
397 | #define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13) | ||
398 | #define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14) | ||
399 | |||
400 | #define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0) | ||
401 | #define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8) | ||
402 | |||
403 | #define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0) | ||
404 | #define SD_CTRL_CARDSTATUS_RW_END (1 << 2) | ||
405 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3) | ||
406 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4) | ||
407 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
408 | #define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7) | ||
409 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8) | ||
410 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9) | ||
411 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
412 | |||
413 | #define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0) | ||
414 | #define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1) | ||
415 | #define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2) | ||
416 | #define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3) | ||
417 | #define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4) | ||
418 | #define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5) | ||
419 | #define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6) | ||
420 | #define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7) | ||
421 | #define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8) | ||
422 | #define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9) | ||
423 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13) | ||
424 | #define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14) | ||
425 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15) | ||
426 | |||
427 | #define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0) | ||
428 | #define SD_CTRL_INTMASKCARD_RW_END (1 << 2) | ||
429 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3) | ||
430 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4) | ||
431 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
432 | #define SD_CTRL_INTMASKCARD_UNK6 (1 << 6) | ||
433 | #define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7) | ||
434 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8) | ||
435 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9) | ||
436 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
437 | |||
438 | #define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0) | ||
439 | #define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1) | ||
440 | #define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2) | ||
441 | #define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3) | ||
442 | #define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4) | ||
443 | #define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5) | ||
444 | #define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6) | ||
445 | #define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7) | ||
446 | #define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8) | ||
447 | #define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9) | ||
448 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13) | ||
449 | #define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14) | ||
450 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15) | ||
451 | |||
452 | #define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0) | ||
453 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2) | ||
454 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3) | ||
455 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4) | ||
456 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5) | ||
457 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8) | ||
458 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9) | ||
459 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10) | ||
460 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11) | ||
461 | |||
462 | #define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0) | ||
463 | #define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4) | ||
464 | #define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5) | ||
465 | #define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6) | ||
466 | |||
467 | #define ASIC3_SDIO_CTRL_Base 0x1200 | ||
468 | |||
469 | #define ASIC3_SDIO_CTRL_Cmd 0x00 | ||
470 | #define ASIC3_SDIO_CTRL_CardPortSel 0x04 | ||
471 | #define ASIC3_SDIO_CTRL_Arg0 0x08 | ||
472 | #define ASIC3_SDIO_CTRL_Arg1 0x0C | ||
473 | #define ASIC3_SDIO_CTRL_TransferBlockCount 0x14 | ||
474 | #define ASIC3_SDIO_CTRL_Response0 0x18 | ||
475 | #define ASIC3_SDIO_CTRL_Response1 0x1C | ||
476 | #define ASIC3_SDIO_CTRL_Response2 0x20 | ||
477 | #define ASIC3_SDIO_CTRL_Response3 0x24 | ||
478 | #define ASIC3_SDIO_CTRL_Response4 0x28 | ||
479 | #define ASIC3_SDIO_CTRL_Response5 0x2C | ||
480 | #define ASIC3_SDIO_CTRL_Response6 0x30 | ||
481 | #define ASIC3_SDIO_CTRL_Response7 0x34 | ||
482 | #define ASIC3_SDIO_CTRL_CardStatus 0x38 | ||
483 | #define ASIC3_SDIO_CTRL_BufferCtrl 0x3C | ||
484 | #define ASIC3_SDIO_CTRL_IntMaskCard 0x40 | ||
485 | #define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44 | ||
486 | #define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C | ||
487 | #define ASIC3_SDIO_CTRL_CardOptionSetup 0x50 | ||
488 | #define ASIC3_SDIO_CTRL_ErrorStatus0 0x54 | ||
489 | #define ASIC3_SDIO_CTRL_ErrorStatus1 0x58 | ||
490 | #define ASIC3_SDIO_CTRL_DataPort 0x60 | ||
491 | #define ASIC3_SDIO_CTRL_TransactionCtrl 0x68 | ||
492 | #define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C | ||
493 | #define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70 | ||
494 | #define ASIC3_SDIO_CTRL_HostInformation 0x74 | ||
495 | #define ASIC3_SDIO_CTRL_ErrorCtrl 0x78 | ||
496 | #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C | ||
497 | #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 | ||
498 | 292 | ||
499 | #define ASIC3_MAP_SIZE_32BIT 0x2000 | 293 | #define ASIC3_MAP_SIZE_32BIT 0x2000 |
500 | #define ASIC3_MAP_SIZE_16BIT 0x1000 | 294 | #define ASIC3_MAP_SIZE_16BIT 0x1000 |