|
@@ -1004,7 +1004,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
|
|
struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
|
|
struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
|
|
int eint_num, virq, eint_offset;
|
|
int eint_num, virq, eint_offset;
|
|
unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
|
|
unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
|
|
- static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256};
|
|
|
|
|
|
+ static const unsigned int debounce_time[] = {500, 1000, 16000, 32000, 64000,
|
|
|
|
+ 128000, 256000};
|
|
const struct mtk_desc_pin *pin;
|
|
const struct mtk_desc_pin *pin;
|
|
struct irq_data *d;
|
|
struct irq_data *d;
|
|
|
|
|
|
@@ -1022,9 +1023,9 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
|
|
if (!mtk_eint_can_en_debounce(pctl, eint_num))
|
|
if (!mtk_eint_can_en_debounce(pctl, eint_num))
|
|
return -ENOSYS;
|
|
return -ENOSYS;
|
|
|
|
|
|
- dbnc = ARRAY_SIZE(dbnc_arr);
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(dbnc_arr); i++) {
|
|
|
|
- if (debounce <= dbnc_arr[i]) {
|
|
|
|
|
|
+ dbnc = ARRAY_SIZE(debounce_time);
|
|
|
|
+ for (i = 0; i < ARRAY_SIZE(debounce_time); i++) {
|
|
|
|
+ if (debounce <= debounce_time[i]) {
|
|
dbnc = i;
|
|
dbnc = i;
|
|
break;
|
|
break;
|
|
}
|
|
}
|