[aadk-commits] dbailey: uClinux/trunk r135 - in
/uClinux/trunk/uClinux-dist/linux-2.6.x/driv...
aadk-commits at lists.digium.com
aadk-commits at lists.digium.com
Wed Jan 24 13:33:35 MST 2007
Author: dbailey
Date: Wed Jan 24 14:33:35 2007
New Revision: 135
URL: http://svn.digium.com/view/aadk?view=rev&rev=135
Log:
Added flag to mmc processing that prevents the sx00i module from interrupting mmc transactions.
This is done much in the same manner as was done for the SPI FLASH.
Modified:
uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mmc/spi_mmc/spi_mmc_core.c
uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mtd/devices/m25p80.c
uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/zaptel/sx00i.c
Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mmc/spi_mmc/spi_mmc_core.c
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mmc/spi_mmc/spi_mmc_core.c?view=diff&rev=135&r1=134&r2=135
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mmc/spi_mmc/spi_mmc_core.c (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mmc/spi_mmc/spi_mmc_core.c Wed Jan 24 14:33:35 2007
@@ -138,7 +138,7 @@
// Kconfig parameters
#ifndef CONFIG_SPI_MMC_CS_CHAN
-#define CONFIG_SPI_MMC_CS_CHAN 4
+#define CONFIG_SPI_MMC_CS_CHAN 7
#endif
#ifndef CONFIG_SPI_MMC_CARD_DETECT_PFLAG
@@ -185,6 +185,9 @@
};
static int request_mode = RM_FULL;
+int mmc_spiinuse = 0;
+EXPORT_SYMBOL(mmc_spiinuse);
+
/**********************************************************************\
*
* Low level helpers, borrowed from bfin_spi_adc.c by Michael Hennerich.
@@ -252,6 +255,7 @@
short retry_flag=0;
down_interruptible(&card_sema);
+ mmc_spiinuse = 1;
pdev->pi.last_block = offset;
/* Multiple write block operations */
@@ -283,6 +287,7 @@
nsect_xf++;
}
out:
+ mmc_spiinuse = 0;
up(&card_sema);
return rval;
@@ -765,7 +770,7 @@
mmc_info_t* pdev = gd->private_data;
down_interruptible(&card_sema);
-
+ mmc_spiinuse = 1;
if(spi_mmc_dev_init(pdev)) {
// No card
pdev->card_in_bay = 0;
@@ -776,6 +781,7 @@
pdev->card_in_bay = 1;
}
set_capacity(pdev->gd, pdev->nsectors * (pdev->hardsect_size / KERNEL_SECTOR_SIZE));
+ mmc_spiinuse = 0;
up(&card_sema);
@@ -841,7 +847,7 @@
//down(&open_lock);
pdev->users++;
DPRINTK("\n");
-
+ mmc_spiinuse = 1;
// allways do full init and revalidation if not on hotplug platform
#ifndef CONFIG_SPI_MMC_CARD_DETECT
spi_mmc_revalidate(pdev->gd);
@@ -852,7 +858,7 @@
pdev->users--;
}
//up(&open_lock);
-
+ mmc_spiinuse = 0;
return rval;
}
Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mtd/devices/m25p80.c
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mtd/devices/m25p80.c?view=diff&rev=135&r1=134&r2=135
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mtd/devices/m25p80.c (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/mtd/devices/m25p80.c Wed Jan 24 14:33:35 2007
@@ -69,8 +69,8 @@
#define mtd_has_partitions() (0)
#endif
-int spiinuse = 0;
-EXPORT_SYMBOL(spiinuse);
+int mtd_spiinuse = 0;
+EXPORT_SYMBOL(mtd_spiinuse);
/****************************************************************************/
@@ -273,11 +273,11 @@
down(&flash->lock);
- spiinuse = 1;
+ mtd_spiinuse = 1;
/* Wait till previous write/erase is done. */
if (wait_till_ready(flash)) {
/* REVISIT status return?? */
- spiinuse = 0;
+ mtd_spiinuse = 0;
up(&flash->lock);
return 1;
}
@@ -294,7 +294,7 @@
*retlen = m.actual_length - sizeof(flash->command) - FAST_READ_DUMMY_BYTE;
- spiinuse = 0;
+ mtd_spiinuse = 0;
up(&flash->lock);
return 0;
@@ -327,7 +327,7 @@
if (to + len > flash->mtd.size)
return -EINVAL;
- spiinuse = 1;
+ mtd_spiinuse = 1;
if ((((int)to % mtd->erasesize) == 0) &&
(len == mtd->erasesize)) {
erase_sector(flash, to);
@@ -347,7 +347,7 @@
/* Wait until finished previous write command. */
if (wait_till_ready(flash)) {
- spiinuse = 0;
+ mtd_spiinuse = 0;
up(&flash->lock);
return 1;
}
@@ -406,7 +406,7 @@
- sizeof(flash->command);
}
}
- spiinuse = 0;
+ mtd_spiinuse = 0;
up(&flash->lock);
return 0;
Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/zaptel/sx00i.c
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/zaptel/sx00i.c?view=diff&rev=135&r1=134&r2=135
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/zaptel/sx00i.c (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/zaptel/sx00i.c Wed Jan 24 14:33:35 2007
@@ -274,7 +274,8 @@
extern spinlock_t spilock;
-extern int spiinuse;
+extern int mtd_spiinuse;
+extern int mmc_spiinuse;
struct calregs {
unsigned char vals[NUM_CAL_REGS];
@@ -1287,7 +1288,7 @@
sx00_receiveprep(wc, rxdma);
sx00_transmitprep(wc, txdma);
- if ((wc->cardflag & (1 << x)) && !spiinuse) {
+ if ((wc->cardflag & (1 << x)) && !mtd_spiinuse && !mmc_spiinuse) {
switch(mode) {
case 0x00:
/* Rest */
More information about the aadk-commits
mailing list