sd.c (ce8ee02d519ab20c5b87d3b3929b5e44ad89e26f) | sd.c (d6743a8a1ae38269a41094ad14d7ef86199f661d) |
---|---|
1/* 2 * linux/drivers/mmc/core/sd.c 3 * 4 * Copyright (C) 2003-2004 Russell King, All Rights Reserved. 5 * SD support Copyright (C) 2004 Ian Molton, All Rights Reserved. 6 * Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 568 unchanged lines hidden (view full) --- 577/* 578 * UHS-I specific initialization procedure 579 */ 580static int mmc_sd_init_uhs_card(struct mmc_card *card) 581{ 582 int err; 583 u8 *status; 584 | 1/* 2 * linux/drivers/mmc/core/sd.c 3 * 4 * Copyright (C) 2003-2004 Russell King, All Rights Reserved. 5 * SD support Copyright (C) 2004 Ian Molton, All Rights Reserved. 6 * Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved. 7 * 8 * This program is free software; you can redistribute it and/or modify --- 568 unchanged lines hidden (view full) --- 577/* 578 * UHS-I specific initialization procedure 579 */ 580static int mmc_sd_init_uhs_card(struct mmc_card *card) 581{ 582 int err; 583 u8 *status; 584 |
585 if (!card->scr.sda_spec3) 586 return 0; 587 | |
588 if (!(card->csd.cmdclass & CCC_SWITCH)) 589 return 0; 590 591 status = kmalloc(64, GFP_KERNEL); 592 if (!status) 593 return -ENOMEM; 594 595 /* Set 4-bit bus width */ | 585 if (!(card->csd.cmdclass & CCC_SWITCH)) 586 return 0; 587 588 status = kmalloc(64, GFP_KERNEL); 589 if (!status) 590 return -ENOMEM; 591 592 /* Set 4-bit bus width */ |
596 if ((card->host->caps & MMC_CAP_4_BIT_DATA) && 597 (card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) { 598 err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4); 599 if (err) 600 goto out; | 593 err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4); 594 if (err) 595 goto out; |
601 | 596 |
602 mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4); 603 } | 597 mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4); |
604 605 /* 606 * Select the bus speed mode depending on host 607 * and card capability. 608 */ 609 sd_update_bus_speed_mode(card); 610 611 /* Set the driver strength for the card */ --- 416 unchanged lines hidden (view full) --- 1028 mmc_remove_card(card); 1029 goto retry; 1030 } 1031 goto done; 1032 } 1033 } 1034 1035 /* Initialization sequence for UHS-I cards */ | 598 599 /* 600 * Select the bus speed mode depending on host 601 * and card capability. 602 */ 603 sd_update_bus_speed_mode(card); 604 605 /* Set the driver strength for the card */ --- 416 unchanged lines hidden (view full) --- 1022 mmc_remove_card(card); 1023 goto retry; 1024 } 1025 goto done; 1026 } 1027 } 1028 1029 /* Initialization sequence for UHS-I cards */ |
1036 if (rocr & SD_ROCR_S18A) { | 1030 if (rocr & SD_ROCR_S18A && mmc_host_uhs(host)) { |
1037 err = mmc_sd_init_uhs_card(card); 1038 if (err) 1039 goto free_card; 1040 } else { 1041 /* 1042 * Attempt to change to high-speed (if supported) 1043 */ 1044 err = mmc_sd_switch_hs(card); --- 262 unchanged lines hidden --- | 1031 err = mmc_sd_init_uhs_card(card); 1032 if (err) 1033 goto free_card; 1034 } else { 1035 /* 1036 * Attempt to change to high-speed (if supported) 1037 */ 1038 err = mmc_sd_switch_hs(card); --- 262 unchanged lines hidden --- |