#endif
// to enable log
-int sms_debug =7;
-//int sms_debug =0; //hzb 0526
+//int sms_debug =7;
+int sms_debug =0; //hzb 0526
// for loopback
char g_LbResBuf[256]={0};
//
return rc;
}
+
//zyc
-static request_cmmb_gpio(void)
+static void request_cmmb_gpio(void)
{
int ret;
ret = gpio_request(CMMB_1186_POWER_RESET, NULL);
}
+static void release_cmmb_gpio(void)
+{
+ gpio_free(CMMB_1186_POWER_RESET);
+ gpio_free(CMMB_1186_POWER_DOWN);
+ gpio_free(CMMB_1186_POWER_ENABLE);
+ printk("leave the release_cmmb_gpio\n");
+
+
+}
+
static int __init smscore_module_init(void)
{
int rc = 0;
kmutex_init(&g_smscore_registrylock);
//request the gpio used by cmmb
- request_cmmb_gpio();
+ //request_cmmb_gpio();
/* Register sub system adapter objects */
+ request_cmmb_gpio();
#ifdef SMS_NET_SUBSYS
/* NET Register */
static void __exit smscore_module_exit(void)
{
+
+
+
#ifdef SMS_NET_SUBSYS
/* Net Unregister */
smsnet_unregister();
kfree(entry);
}
kmutex_unlock(&g_smscore_registrylock);
+
+ release_cmmb_gpio();
sms_debug("");
}
#include "smscoreapi.h"
#include <linux/notifier.h>
+#include <mach/iomux.h>
+
//#define CMMB_1186_SPIIRQ RK2818_PIN_PE1 //This Pin is SDK Board GPIOPortE_Pin1
//#define CMMB_1186_PWR_EN GPIOPortH_Pin7//This Pin is SDK Board GPIOPortE_Pin1
}
spiphy_dev = (struct spiphy_dev_s *) context;
- free_irq(gpio_to_irq(CMMB_1186_SPIIRQ), NULL);
+ // free_irq(gpio_to_irq(CMMB_1186_SPIIRQ), NULL);
chip_powerdown();
return -1 ;
}
-
void *smsspiphy_init(void *context, void (*smsspi_interruptHandler) (void *),
void *intr_context)
{
sms_err("spiphy_dev is null in smsspiphy_init\n") ;
return NULL;
}
+
chip_powerdown();
spiphy_dev->interruptHandler = smsspi_interruptHandler;
spiphy_dev->intr_context = intr_context;
spiphy_dev->Smsdevice = (struct spi_device*)context;
//gpio_pull_updown(CMMB_1186_SPIIRQ, IRQT_FALLING);
+ //ÉèÖÃCMMB ÖжϽÅIOMUX
+
+ rk2818_mux_api_set(GPIOA6_FLASHCS2_SEL_NAME, 0);
error = gpio_request(CMMB_1186_SPIIRQ,"cmmb irq");
if (error) {
//dev_err(&pdev->dev, "failed to request play key gpio\n");
}
//ret = request_gpio_irq(CMMB_1186_SPIIRQ, spibus_interrupt, GPIOEdgelRising, spiphy_dev);//
gpio_pull_updown(CMMB_1186_SPIIRQ,GPIOPullUp);
- //ret = request_gpio_irq(CMMB_1186_SPIIRQ, (pFunc)spibus_interrupt, GPIOEdgelRising, spiphy_dev);
+ //ret = request_gpio_irq(CMMB_-rwxrwxrwx 1 root root 8 2010-09-20 17:43 built-in.o
+ //-rwxrwxrwx 1 root root 6927 2010-09-19 10:42 compat.h
+ //-rwxrwxrwx 1 root root 1748 2010-09-21 15:06 Kconfig
+ //-rwxrwxrwx 1 root root 2518 2010-09-19 10:42 Makefile
+ //-rwxrwxrwx 1 root root 37 2010-09-21 20:27 modules.order
+ //-rwxrwxrwx 1 root root 9890 2010-09-19 10:42 sms-cards.c
+ //-rwxrwxrwx 1 root root 2752 2010-09-19 10:42 sms-cards.h
+ //-rwxrwxrwx 1 root root 5416 2010-09-21 19:47 sms-cards.o
+ //-rwxrwxrwx 1 root root 20493 2010-09-21 19:46 smschar.c
+ //-rwxrwxrwx 1 root root 1916 2010-09-19 10:42 smscharioctl.h
+ //-rwxrwxrwx 1 root root 12440 2010-09-21 19:47 smschar.o
+ //-rwxrwxrwx 1 root root 53173 2010-09-21 19:46 smscoreapi.c
+ //-rwxrwxrwx 1 root root 16701 2010-09-21 19:46 smscoreapi.h
+ //-rwxrwxrwx 1 root root 25516 2010-09-21 19:47 smscoreapi.o
+ //-rwxrwxrwx 1 root root 1982 2010-09-19 10:42 smsdbg_prn.h
+ //-rwxrwxrwx 1 root root 2409 2010-09-19 10:42 smsendian.c
+ //-rwxrwxrwx 1 root root 1100 2010-09-19 10:42 smsendian.h
+ //-rwxrwxrwx 1 root root 1140 2010-09-21 19:47 smsendian.o
+ //-rwxrwxrwx 1 root root 58990 2010-09-21 19:48 smsmdtv.ko
+ //-rwxrwxrwx 1 root root 1578 2010-09-19 16:15 smsmdtv.mod.c
+ //-rwxrwxrwx 1 root root 2984 2010-09-20 17:43 smsmdtv.mod.o
+ //-rwxrwxrwx 1 root root 56673 2010-09-21 19:47 smsmdtv.o
+ //-rwxrwxrwx 1 root root 11950 2010-09-21 19:46 smsspicommon.c
+ //-rwxrwxrwx 1 root root 2496 2010-09-19 10:42 smsspicommon.h
+ //-rwxrwxrwx 1 root root 3800 2010-09-21 19:47 smsspicommon.o
+ //-rwxrwxrwx 1 root root 23441 2010-09-21 19:46 smsspilog.c
+ //-rwxrwxrwx 1 root root 12260 2010-09-21 19:47 smsspilog.o
+ //-rwxrwxrwx 1 root root 1512 2010-09-19 10:42 smsspiphy.h
+ //-rwxrwxrwx 1 root root 20394 2010-09-17 11:22 smsspiphy_pxa.c
+ //-rwxrwxrwx 1 root root 11895 2010-09-21 19:46 smsspiphy_rk.c
+ //-rwxrwxrwx 1 root root 5480 2010-09-21 19:47 smsspiphy_rk.o
+ //root@zyc-desktop:/usr/android_source/android_cmmb_dev/kernel/kernel/drivers/cmmb/siano#
+ //
+ //1186_SPIIRQ, (pFunc)spibus_interrupt, GPIOEdgelRising, spiphy_dev);
request_irq(gpio_to_irq(CMMB_1186_SPIIRQ),spibus_interrupt,IRQF_TRIGGER_RISING,NULL,spiphy_dev);
if(ret<0){
chip_powerdown();
sms_info("exiting\n");
free_irq(gpio_to_irq(CMMB_1186_SPIIRQ), NULL);
-
+ gpio_free(CMMB_1186_SPIIRQ);
return 0;
}