Changeset 113


Ignore:
Timestamp:
Mar 20, 2011, 1:28:29 PM (6 years ago)
Author:
phj
Message:

SD card insert/remove: use interrupt to track the changes

Location:
kern_oII
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • kern_oII/arch/arm/mach-s3c6410/setup-sdhci.c

    r105 r113  
    5858                ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); 
    5959 
    60         printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); 
     60//      printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); 
    6161        writel(ctrl2, r + S3C_SDHCI_CONTROL2); 
    6262        writel(ctrl3, r + S3C_SDHCI_CONTROL3); 
  • kern_oII/arch/arm/plat-s3c/dev-hsmmc.c

    r105 r113  
    1515#include <linux/platform_device.h> 
    1616#include <linux/mmc/host.h> 
     17#include <linux/io.h> 
    1718 
    1819#include <mach/map.h> 
     
    2021#include <plat/devs.h> 
    2122#include <plat/cpu.h> 
     23#include <plat/regs-gpio.h> 
    2224 
    2325#define S3C_SZ_HSMMC    (0x1000) 
     
    3335                .end   = IRQ_HSMMC0, 
    3436                .flags = IORESOURCE_IRQ, 
     37        }, 
     38        [2] = { 
     39                .start = IRQ_EINT(6), 
     40                .end   = IRQ_EINT(6), 
     41                .flags = IORESOURCE_IRQ, 
    3542        } 
    3643}; 
     
    3845static u64 s3c_device_hsmmc_dmamask = 0xffffffffUL; 
    3946 
     47static unsigned int detect_ext_cd( void ) { 
     48    return(readl(S3C64XX_GPNDAT) & 0x40 ? 0 : 1); /* GPN6 */ 
     49} 
     50static void cfg_ext_cd( void ) { 
     51        printk("MMC cd config"); 
     52} 
     53 
    4054struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = { 
    4155        .max_width      = 4, 
    4256        .host_caps      = (MMC_CAP_4_BIT_DATA | 
    4357                           MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), 
     58        .ext_cd = IRQ_EINT(6), 
     59        .detect_ext_cd = detect_ext_cd, 
     60        .cfg_ext_cd = cfg_ext_cd, 
    4461}; 
    4562 
  • kern_oII/drivers/mmc/host/sdhci-s3c.c

    r105 r113  
    269269        if(pdata->adjust_cfg_card) 
    270270                pdata->adjust_cfg_card(pdata, host->ioaddr, rw); 
     271        return 0; 
    271272} 
    272273 
     
    296297{ 
    297298        struct sdhci_s3c* sc = dev_id; 
     299        uint detect = sc->pdata->detect_ext_cd(); 
    298300 
    299301        printk(KERN_DEBUG "sdhci: card interrupt.\n"); 
    300  
    301         uint detect = sc->pdata->detect_ext_cd(); 
    302302 
    303303        if (detect) { 
     
    407407        /* Ensure we have minimal gpio selected CMD/CLK/Detect */ 
    408408        if (pdata->cfg_gpio) 
    409                 pdata->cfg_gpio(pdev, pdata->max_width); 
     409                pdata->cfg_gpio(pdev, pdata->max_width);        //???? 
    410410 
    411411        if (pdata->get_ro) 
Note: See TracChangeset for help on using the changeset viewer.