kbc 143 drivers/input/keyboard/tegra-kbc.c static void tegra_kbc_report_keys(struct tegra_kbc *kbc) kbc 156 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_KP_ENT0_0 + i); kbc 165 drivers/input/keyboard/tegra-kbc.c keycodes[num_down] = kbc->keycode[scancode]; kbc 167 drivers/input/keyboard/tegra-kbc.c if ((keycodes[num_down] == KEY_FN) && kbc->use_fn_map) kbc 182 drivers/input/keyboard/tegra-kbc.c if (kbc->use_ghost_filter && num_down >= 3) { kbc 210 drivers/input/keyboard/tegra-kbc.c scancodes[i] += kbc->max_keys; kbc 211 drivers/input/keyboard/tegra-kbc.c keycodes[i] = kbc->keycode[scancodes[i]]; kbc 219 drivers/input/keyboard/tegra-kbc.c tegra_kbc_report_released_keys(kbc->idev, kbc 220 drivers/input/keyboard/tegra-kbc.c kbc->current_keys, kbc->num_pressed_keys, kbc 222 drivers/input/keyboard/tegra-kbc.c tegra_kbc_report_pressed_keys(kbc->idev, scancodes, keycodes, num_down); kbc 223 drivers/input/keyboard/tegra-kbc.c input_sync(kbc->idev); kbc 225 drivers/input/keyboard/tegra-kbc.c memcpy(kbc->current_keys, keycodes, sizeof(kbc->current_keys)); kbc 226 drivers/input/keyboard/tegra-kbc.c kbc->num_pressed_keys = num_down; kbc 229 drivers/input/keyboard/tegra-kbc.c static void tegra_kbc_set_fifo_interrupt(struct tegra_kbc *kbc, bool enable) kbc 233 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_CONTROL_0); kbc 238 drivers/input/keyboard/tegra-kbc.c writel(val, kbc->mmio + KBC_CONTROL_0); kbc 243 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc = from_timer(kbc, t, timer); kbc 248 drivers/input/keyboard/tegra-kbc.c spin_lock_irqsave(&kbc->lock, flags); kbc 250 drivers/input/keyboard/tegra-kbc.c val = (readl(kbc->mmio + KBC_INT_0) >> 4) & 0xf; kbc 254 drivers/input/keyboard/tegra-kbc.c tegra_kbc_report_keys(kbc); kbc 260 drivers/input/keyboard/tegra-kbc.c dly = (val == 1) ? kbc->repoll_dly : 1; kbc 261 drivers/input/keyboard/tegra-kbc.c mod_timer(&kbc->timer, jiffies + msecs_to_jiffies(dly)); kbc 264 drivers/input/keyboard/tegra-kbc.c for (i = 0; i < kbc->num_pressed_keys; i++) kbc 265 drivers/input/keyboard/tegra-kbc.c input_report_key(kbc->idev, kbc->current_keys[i], 0); kbc 266 drivers/input/keyboard/tegra-kbc.c input_sync(kbc->idev); kbc 268 drivers/input/keyboard/tegra-kbc.c kbc->num_pressed_keys = 0; kbc 271 drivers/input/keyboard/tegra-kbc.c tegra_kbc_set_fifo_interrupt(kbc, true); kbc 274 drivers/input/keyboard/tegra-kbc.c spin_unlock_irqrestore(&kbc->lock, flags); kbc 279 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc = args; kbc 283 drivers/input/keyboard/tegra-kbc.c spin_lock_irqsave(&kbc->lock, flags); kbc 289 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_INT_0); kbc 290 drivers/input/keyboard/tegra-kbc.c writel(val, kbc->mmio + KBC_INT_0); kbc 297 drivers/input/keyboard/tegra-kbc.c tegra_kbc_set_fifo_interrupt(kbc, false); kbc 298 drivers/input/keyboard/tegra-kbc.c mod_timer(&kbc->timer, jiffies + kbc->cp_dly_jiffies); kbc 301 drivers/input/keyboard/tegra-kbc.c kbc->keypress_caused_wake = true; kbc 304 drivers/input/keyboard/tegra-kbc.c spin_unlock_irqrestore(&kbc->lock, flags); kbc 309 drivers/input/keyboard/tegra-kbc.c static void tegra_kbc_setup_wakekeys(struct tegra_kbc *kbc, bool filter) kbc 315 drivers/input/keyboard/tegra-kbc.c rst_val = (filter && !kbc->wakeup) ? ~0 : 0; kbc 317 drivers/input/keyboard/tegra-kbc.c for (i = 0; i < kbc->hw_support->max_rows; i++) kbc 318 drivers/input/keyboard/tegra-kbc.c writel(rst_val, kbc->mmio + KBC_ROW0_MASK_0 + i * 4); kbc 321 drivers/input/keyboard/tegra-kbc.c static void tegra_kbc_config_pins(struct tegra_kbc *kbc) kbc 332 drivers/input/keyboard/tegra-kbc.c u32 row_cfg = readl(kbc->mmio + r_offs); kbc 333 drivers/input/keyboard/tegra-kbc.c u32 col_cfg = readl(kbc->mmio + c_offs); kbc 338 drivers/input/keyboard/tegra-kbc.c switch (kbc->pin_cfg[i].type) { kbc 340 drivers/input/keyboard/tegra-kbc.c row_cfg |= ((kbc->pin_cfg[i].num << 1) | 1) << r_shft; kbc 344 drivers/input/keyboard/tegra-kbc.c col_cfg |= ((kbc->pin_cfg[i].num << 1) | 1) << c_shft; kbc 351 drivers/input/keyboard/tegra-kbc.c writel(row_cfg, kbc->mmio + r_offs); kbc 352 drivers/input/keyboard/tegra-kbc.c writel(col_cfg, kbc->mmio + c_offs); kbc 356 drivers/input/keyboard/tegra-kbc.c static int tegra_kbc_start(struct tegra_kbc *kbc) kbc 362 drivers/input/keyboard/tegra-kbc.c ret = clk_prepare_enable(kbc->clk); kbc 367 drivers/input/keyboard/tegra-kbc.c reset_control_assert(kbc->rst); kbc 369 drivers/input/keyboard/tegra-kbc.c reset_control_deassert(kbc->rst); kbc 372 drivers/input/keyboard/tegra-kbc.c tegra_kbc_config_pins(kbc); kbc 373 drivers/input/keyboard/tegra-kbc.c tegra_kbc_setup_wakekeys(kbc, false); kbc 375 drivers/input/keyboard/tegra-kbc.c writel(kbc->repeat_cnt, kbc->mmio + KBC_RPT_DLY_0); kbc 378 drivers/input/keyboard/tegra-kbc.c debounce_cnt = min(kbc->debounce_cnt, KBC_MAX_DEBOUNCE_CNT); kbc 383 drivers/input/keyboard/tegra-kbc.c writel(val, kbc->mmio + KBC_CONTROL_0); kbc 389 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_INIT_DLY_0); kbc 390 drivers/input/keyboard/tegra-kbc.c kbc->cp_dly_jiffies = usecs_to_jiffies((val & 0xfffff) * 32); kbc 392 drivers/input/keyboard/tegra-kbc.c kbc->num_pressed_keys = 0; kbc 399 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_INT_0); kbc 404 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_KP_ENT0_0); kbc 405 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_KP_ENT1_0); kbc 407 drivers/input/keyboard/tegra-kbc.c writel(0x7, kbc->mmio + KBC_INT_0); kbc 409 drivers/input/keyboard/tegra-kbc.c enable_irq(kbc->irq); kbc 414 drivers/input/keyboard/tegra-kbc.c static void tegra_kbc_stop(struct tegra_kbc *kbc) kbc 419 drivers/input/keyboard/tegra-kbc.c spin_lock_irqsave(&kbc->lock, flags); kbc 420 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_CONTROL_0); kbc 422 drivers/input/keyboard/tegra-kbc.c writel(val, kbc->mmio + KBC_CONTROL_0); kbc 423 drivers/input/keyboard/tegra-kbc.c spin_unlock_irqrestore(&kbc->lock, flags); kbc 425 drivers/input/keyboard/tegra-kbc.c disable_irq(kbc->irq); kbc 426 drivers/input/keyboard/tegra-kbc.c del_timer_sync(&kbc->timer); kbc 428 drivers/input/keyboard/tegra-kbc.c clk_disable_unprepare(kbc->clk); kbc 433 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc = input_get_drvdata(dev); kbc 435 drivers/input/keyboard/tegra-kbc.c return tegra_kbc_start(kbc); kbc 440 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc = input_get_drvdata(dev); kbc 442 drivers/input/keyboard/tegra-kbc.c return tegra_kbc_stop(kbc); kbc 445 drivers/input/keyboard/tegra-kbc.c static bool tegra_kbc_check_pin_cfg(const struct tegra_kbc *kbc, kbc 453 drivers/input/keyboard/tegra-kbc.c const struct tegra_kbc_pin_cfg *pin_cfg = &kbc->pin_cfg[i]; kbc 457 drivers/input/keyboard/tegra-kbc.c if (pin_cfg->num >= kbc->hw_support->max_rows) { kbc 458 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, kbc 467 drivers/input/keyboard/tegra-kbc.c if (pin_cfg->num >= kbc->hw_support->max_columns) { kbc 468 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, kbc 479 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, kbc 489 drivers/input/keyboard/tegra-kbc.c static int tegra_kbc_parse_dt(struct tegra_kbc *kbc) kbc 491 drivers/input/keyboard/tegra-kbc.c struct device_node *np = kbc->dev->of_node; kbc 502 drivers/input/keyboard/tegra-kbc.c kbc->debounce_cnt = prop; kbc 505 drivers/input/keyboard/tegra-kbc.c kbc->repeat_cnt = prop; kbc 508 drivers/input/keyboard/tegra-kbc.c kbc->use_ghost_filter = true; kbc 512 drivers/input/keyboard/tegra-kbc.c kbc->wakeup = true; kbc 515 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, "property nvidia,kbc-row-pins not found\n"); kbc 521 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, "property nvidia,kbc-col-pins not found\n"); kbc 526 drivers/input/keyboard/tegra-kbc.c if (num_rows > kbc->hw_support->max_rows) { kbc 527 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, kbc 532 drivers/input/keyboard/tegra-kbc.c if (num_cols > kbc->hw_support->max_columns) { kbc 533 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, kbc 539 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, "property linux,keymap not found\n"); kbc 544 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, kbc 550 drivers/input/keyboard/tegra-kbc.c for (i = 0; i < kbc->num_rows_and_columns; i++) kbc 551 drivers/input/keyboard/tegra-kbc.c kbc->pin_cfg[i].type = PIN_CFG_IGNORE; kbc 556 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, "Rows configurations are not proper\n"); kbc 563 drivers/input/keyboard/tegra-kbc.c dev_err(kbc->dev, "Cols configurations are not proper\n"); kbc 568 drivers/input/keyboard/tegra-kbc.c kbc->pin_cfg[rows_cfg[i]].type = PIN_CFG_ROW; kbc 569 drivers/input/keyboard/tegra-kbc.c kbc->pin_cfg[rows_cfg[i]].num = i; kbc 573 drivers/input/keyboard/tegra-kbc.c kbc->pin_cfg[cols_cfg[i]].type = PIN_CFG_COL; kbc 574 drivers/input/keyboard/tegra-kbc.c kbc->pin_cfg[cols_cfg[i]].num = i; kbc 600 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc; kbc 611 drivers/input/keyboard/tegra-kbc.c kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL); kbc 612 drivers/input/keyboard/tegra-kbc.c if (!kbc) { kbc 617 drivers/input/keyboard/tegra-kbc.c kbc->dev = &pdev->dev; kbc 618 drivers/input/keyboard/tegra-kbc.c kbc->hw_support = match->data; kbc 619 drivers/input/keyboard/tegra-kbc.c kbc->max_keys = kbc->hw_support->max_rows * kbc 620 drivers/input/keyboard/tegra-kbc.c kbc->hw_support->max_columns; kbc 621 drivers/input/keyboard/tegra-kbc.c kbc->num_rows_and_columns = kbc->hw_support->max_rows + kbc 622 drivers/input/keyboard/tegra-kbc.c kbc->hw_support->max_columns; kbc 623 drivers/input/keyboard/tegra-kbc.c keymap_rows = kbc->max_keys; kbc 624 drivers/input/keyboard/tegra-kbc.c spin_lock_init(&kbc->lock); kbc 626 drivers/input/keyboard/tegra-kbc.c err = tegra_kbc_parse_dt(kbc); kbc 630 drivers/input/keyboard/tegra-kbc.c if (!tegra_kbc_check_pin_cfg(kbc, &num_rows)) kbc 633 drivers/input/keyboard/tegra-kbc.c kbc->irq = platform_get_irq(pdev, 0); kbc 634 drivers/input/keyboard/tegra-kbc.c if (kbc->irq < 0) kbc 637 drivers/input/keyboard/tegra-kbc.c kbc->idev = devm_input_allocate_device(&pdev->dev); kbc 638 drivers/input/keyboard/tegra-kbc.c if (!kbc->idev) { kbc 643 drivers/input/keyboard/tegra-kbc.c timer_setup(&kbc->timer, tegra_kbc_keypress_timer, 0); kbc 646 drivers/input/keyboard/tegra-kbc.c kbc->mmio = devm_ioremap_resource(&pdev->dev, res); kbc 647 drivers/input/keyboard/tegra-kbc.c if (IS_ERR(kbc->mmio)) kbc 648 drivers/input/keyboard/tegra-kbc.c return PTR_ERR(kbc->mmio); kbc 650 drivers/input/keyboard/tegra-kbc.c kbc->clk = devm_clk_get(&pdev->dev, NULL); kbc 651 drivers/input/keyboard/tegra-kbc.c if (IS_ERR(kbc->clk)) { kbc 653 drivers/input/keyboard/tegra-kbc.c return PTR_ERR(kbc->clk); kbc 656 drivers/input/keyboard/tegra-kbc.c kbc->rst = devm_reset_control_get(&pdev->dev, "kbc"); kbc 657 drivers/input/keyboard/tegra-kbc.c if (IS_ERR(kbc->rst)) { kbc 659 drivers/input/keyboard/tegra-kbc.c return PTR_ERR(kbc->rst); kbc 668 drivers/input/keyboard/tegra-kbc.c debounce_cnt = min(kbc->debounce_cnt, KBC_MAX_DEBOUNCE_CNT); kbc 670 drivers/input/keyboard/tegra-kbc.c kbc->repoll_dly = KBC_ROW_SCAN_DLY + scan_time_rows + kbc->repeat_cnt; kbc 671 drivers/input/keyboard/tegra-kbc.c kbc->repoll_dly = DIV_ROUND_UP(kbc->repoll_dly, KBC_CYCLE_MS); kbc 673 drivers/input/keyboard/tegra-kbc.c kbc->idev->name = pdev->name; kbc 674 drivers/input/keyboard/tegra-kbc.c kbc->idev->id.bustype = BUS_HOST; kbc 675 drivers/input/keyboard/tegra-kbc.c kbc->idev->dev.parent = &pdev->dev; kbc 676 drivers/input/keyboard/tegra-kbc.c kbc->idev->open = tegra_kbc_open; kbc 677 drivers/input/keyboard/tegra-kbc.c kbc->idev->close = tegra_kbc_close; kbc 679 drivers/input/keyboard/tegra-kbc.c if (kbc->keymap_data && kbc->use_fn_map) kbc 682 drivers/input/keyboard/tegra-kbc.c err = matrix_keypad_build_keymap(kbc->keymap_data, NULL, kbc 684 drivers/input/keyboard/tegra-kbc.c kbc->hw_support->max_columns, kbc 685 drivers/input/keyboard/tegra-kbc.c kbc->keycode, kbc->idev); kbc 691 drivers/input/keyboard/tegra-kbc.c __set_bit(EV_REP, kbc->idev->evbit); kbc 692 drivers/input/keyboard/tegra-kbc.c input_set_capability(kbc->idev, EV_MSC, MSC_SCAN); kbc 694 drivers/input/keyboard/tegra-kbc.c input_set_drvdata(kbc->idev, kbc); kbc 696 drivers/input/keyboard/tegra-kbc.c err = devm_request_irq(&pdev->dev, kbc->irq, tegra_kbc_isr, kbc 697 drivers/input/keyboard/tegra-kbc.c IRQF_TRIGGER_HIGH, pdev->name, kbc); kbc 703 drivers/input/keyboard/tegra-kbc.c disable_irq(kbc->irq); kbc 705 drivers/input/keyboard/tegra-kbc.c err = input_register_device(kbc->idev); kbc 711 drivers/input/keyboard/tegra-kbc.c platform_set_drvdata(pdev, kbc); kbc 712 drivers/input/keyboard/tegra-kbc.c device_init_wakeup(&pdev->dev, kbc->wakeup); kbc 718 drivers/input/keyboard/tegra-kbc.c static void tegra_kbc_set_keypress_interrupt(struct tegra_kbc *kbc, bool enable) kbc 722 drivers/input/keyboard/tegra-kbc.c val = readl(kbc->mmio + KBC_CONTROL_0); kbc 727 drivers/input/keyboard/tegra-kbc.c writel(val, kbc->mmio + KBC_CONTROL_0); kbc 733 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc = platform_get_drvdata(pdev); kbc 735 drivers/input/keyboard/tegra-kbc.c mutex_lock(&kbc->idev->mutex); kbc 737 drivers/input/keyboard/tegra-kbc.c disable_irq(kbc->irq); kbc 738 drivers/input/keyboard/tegra-kbc.c del_timer_sync(&kbc->timer); kbc 739 drivers/input/keyboard/tegra-kbc.c tegra_kbc_set_fifo_interrupt(kbc, false); kbc 742 drivers/input/keyboard/tegra-kbc.c writel(0x7, kbc->mmio + KBC_INT_0); kbc 747 drivers/input/keyboard/tegra-kbc.c kbc->cp_to_wkup_dly = readl(kbc->mmio + KBC_TO_CNT_0); kbc 748 drivers/input/keyboard/tegra-kbc.c writel(0, kbc->mmio + KBC_TO_CNT_0); kbc 750 drivers/input/keyboard/tegra-kbc.c tegra_kbc_setup_wakekeys(kbc, true); kbc 753 drivers/input/keyboard/tegra-kbc.c kbc->keypress_caused_wake = false; kbc 755 drivers/input/keyboard/tegra-kbc.c tegra_kbc_set_keypress_interrupt(kbc, true); kbc 756 drivers/input/keyboard/tegra-kbc.c enable_irq(kbc->irq); kbc 757 drivers/input/keyboard/tegra-kbc.c enable_irq_wake(kbc->irq); kbc 759 drivers/input/keyboard/tegra-kbc.c if (kbc->idev->users) kbc 760 drivers/input/keyboard/tegra-kbc.c tegra_kbc_stop(kbc); kbc 762 drivers/input/keyboard/tegra-kbc.c mutex_unlock(&kbc->idev->mutex); kbc 770 drivers/input/keyboard/tegra-kbc.c struct tegra_kbc *kbc = platform_get_drvdata(pdev); kbc 773 drivers/input/keyboard/tegra-kbc.c mutex_lock(&kbc->idev->mutex); kbc 775 drivers/input/keyboard/tegra-kbc.c disable_irq_wake(kbc->irq); kbc 776 drivers/input/keyboard/tegra-kbc.c tegra_kbc_setup_wakekeys(kbc, false); kbc 778 drivers/input/keyboard/tegra-kbc.c tegra_kbc_set_keypress_interrupt(kbc, false); kbc 781 drivers/input/keyboard/tegra-kbc.c writel(kbc->cp_to_wkup_dly, kbc->mmio + KBC_TO_CNT_0); kbc 783 drivers/input/keyboard/tegra-kbc.c tegra_kbc_set_fifo_interrupt(kbc, true); kbc 785 drivers/input/keyboard/tegra-kbc.c if (kbc->keypress_caused_wake && kbc->wakeup_key) { kbc 793 drivers/input/keyboard/tegra-kbc.c input_report_key(kbc->idev, kbc->wakeup_key, 1); kbc 794 drivers/input/keyboard/tegra-kbc.c input_sync(kbc->idev); kbc 795 drivers/input/keyboard/tegra-kbc.c input_report_key(kbc->idev, kbc->wakeup_key, 0); kbc 796 drivers/input/keyboard/tegra-kbc.c input_sync(kbc->idev); kbc 799 drivers/input/keyboard/tegra-kbc.c if (kbc->idev->users) kbc 800 drivers/input/keyboard/tegra-kbc.c err = tegra_kbc_start(kbc); kbc 802 drivers/input/keyboard/tegra-kbc.c mutex_unlock(&kbc->idev->mutex); kbc 1494 drivers/pinctrl/tegra/pinctrl-tegra114.c FUNCTION(kbc), kbc 1656 drivers/pinctrl/tegra/pinctrl-tegra124.c FUNCTION(kbc), kbc 1920 drivers/pinctrl/tegra/pinctrl-tegra20.c FUNCTION(kbc), kbc 2052 drivers/pinctrl/tegra/pinctrl-tegra30.c FUNCTION(kbc),