summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-mt2601/mt_freqhopping.c10
-rw-r--r--drivers/misc/mediatek/gpio/mt2601/mt_gpio_debug.c21
2 files changed, 12 insertions, 19 deletions
diff --git a/arch/arm/mach-mt2601/mt_freqhopping.c b/arch/arm/mach-mt2601/mt_freqhopping.c
index 5dee9c47025f..5f8b7a189f66 100644
--- a/arch/arm/mach-mt2601/mt_freqhopping.c
+++ b/arch/arm/mach-mt2601/mt_freqhopping.c
@@ -715,6 +715,11 @@ static INT32 freqhop_proc_dbg_write(struct file *file, const char *buffer, size_
}
break;
case 2:{ /* - config hopping => 2 x pll_id dds hop_dds 0 0 */
+ if (p3 >= NUM_OF_PLL_ID) {
+ fhctl_err("pll_id index out of range %x\n",p3);
+ count = -1;
+ break;
+ }
/* - disable FIRST */
freqhop_fhctlx_disable(p3, FHCTL_HOPPING, 1);
if (p2 == 0) { /* - disable */
@@ -727,6 +732,11 @@ static INT32 freqhop_proc_dbg_write(struct file *file, const char *buffer, size_
}
break;
case 3:{ /* - config SSC => 3 x pll_id dds ssc_df ssc_dt uplmt dnlmt */
+ if (p3 >= NUM_OF_PLL_ID) {
+ fhctl_err("pll_id index out of range %x\n",p3);
+ count = -1;
+ break;
+ }
if (p2 == 0) { /* - disable FIRST */
freqhop_fhctlx_disable(p3, FHCTL_SSC, 1);
} else if (p2 == 1) { /* - enable, but disable FIRST */
diff --git a/drivers/misc/mediatek/gpio/mt2601/mt_gpio_debug.c b/drivers/misc/mediatek/gpio/mt2601/mt_gpio_debug.c
index 956008ef11ae..a36ed2944a1e 100644
--- a/drivers/misc/mediatek/gpio/mt2601/mt_gpio_debug.c
+++ b/drivers/misc/mediatek/gpio/mt2601/mt_gpio_debug.c
@@ -636,7 +636,7 @@ ssize_t mt_gpio_show_pin(struct device *dev,
{
return mt_gpio_dump_regs(buf, PAGE_SIZE);
}
-void mt_get_md_gpio_debug(char *str);
+
/*---------------------------------------------------------------------------*/
ssize_t mt_gpio_store_pin(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
@@ -644,7 +644,7 @@ ssize_t mt_gpio_store_pin(struct device *dev, struct device_attribute *attr,
int pin;
int mode, pullsel, dout, pullen, dir, dinv, din, ies;
u32 num, src, div;
- char md_str[128] = "GPIO_MD_TEST";
+
/* struct mt_gpio_obj *obj = (struct mt_gpio_obj*)dev_get_drvdata(dev); */
if (!strncmp(buf, "-h", 2)) {
GPIOMSG("cat pin #show all pin setting\n");
@@ -705,10 +705,6 @@ ssize_t mt_gpio_store_pin(struct device *dev, struct device_attribute *attr,
gpio_dump_regs();
} else if (!strncmp(buf, "-d", 2)) {
mt_gpio_dump();
- } else if (!strncmp(buf, "-md", 3)) {
- buf += 3;
- sscanf(buf, "%s", md_str);
- mt_get_md_gpio_debug(md_str);
} else if (!strncmp(buf, "-k", 2)) {
buf += 2;
if (!strncmp(buf, "s", 1) && (3 == sscanf(buf+1, "%d %d %d", &num, &src, &div)))
@@ -808,16 +804,3 @@ int mt_get_md_gpio(char *gpio_name, int len)
GPIOERR("Modem gpio name can't match!!!\n");
return -1;
}
-
-void mt_get_md_gpio_debug(char *str)
-{
- if (strcmp(str, "ALL") == 0) {
- int i;
- for (i = 0; i < ARRAY_SIZE(mt_gpio_info); i++) {
- GPIOMSG("GPIO number=%d,%s\n", mt_gpio_info[i].num, mt_gpio_info[i].name);
- }
- } else{
- GPIOMSG("GPIO number=%d,%s\n", mt_get_md_gpio(str, strlen(str)), str);
- }
- return;
-}