Thanks
i will test this patch with SD card-present detect GPIO by using this mod:
http://wiki.openwrt.org/ru/toh/tp-link/ … p.mmc.hack
with some changes:
...
#define TL_MR3X20_GPIO_BTN_MMC <GPIO number>
...
/*
* MMC-on-SPI setup code
*/
/* Which GPIO line is connected to the card-present detect line? */
#define MMC_CARD_PRESENT_GPIO TL_MR3X20_GPIO_BTN_MMC
/*
* Initializes SPI system to communicate with MMC/SD card
*/
static int ath79_mmc_spi_init(struct device *pdev, irqreturn_t (*card_det_irq_handler)(int, void *),
void *mmc)
{
int err, irq;
err = gpio_request(MMC_CARD_PRESENT_GPIO, "ath79-mmc-spi");
if (err)
return err;
err = gpio_direction_input(MMC_CARD_PRESENT_GPIO);
if (err)
goto fail;
irq = gpio_to_irq(MMC_CARD_PRESENT_GPIO);
err = request_irq(irq, card_det_irq_handler,
IRQF_DISABLED | IRQF_TRIGGER_FALLING,
"ath79-mmc-spi", mmc);
if (err == 0) {
printk(KERN_INFO "ath79-mmc-spi: assigned card detection IRQ %d\n", irq);
} else {
dev_err(pdev, "Cannot assign MMC/SD card detection IRQ (%i)!\n", irq);
goto fail;
}
return 0;
fail:
gpio_free(MMC_CARD_PRESENT_GPIO);
return err;
}
static void ath79_mmc_spi_exit(struct device *pdev, void *mmc)
{
free_irq(gpio_to_irq(MMC_CARD_PRESENT_GPIO), mmc);
gpio_free(MMC_CARD_PRESENT_GPIO);
}
static struct mmc_spi_platform_data ath79_mmc_data = {
.init = &ath79_mmc_spi_init, /* set up card detect GPIO IRQ */
.exit = &ath79_mmc_spi_exit,
.get_ro = NULL, /* no read-only detection here */
.detect_delay = 100, /* card detection delay in msec */
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
};
static struct ath79_spi_controller_data ath79_spi1_cdata = {
.cs_type = ATH79_SPI_CS_TYPE_GPIO,
.cs_line = TL_MR3X20_GPIO_CS1_MMC,
};
...
offtopic
io util you can find on BB branches, just add it in /etc/opkg.conf next:
...
src/gz barrier_breaker_oldpackages http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages
after this:
(Last edited by Deoptim on 10 Oct 2014, 16:25)