Lines Matching full:bbnsm

47 	struct bbnsm_pwrkey *bbnsm = from_timer(bbnsm, t, check_timer);  in bbnsm_pwrkey_check_for_events()  local
48 struct input_dev *input = bbnsm->input; in bbnsm_pwrkey_check_for_events()
51 regmap_read(bbnsm->regmap, BBNSM_EVENTS, &state); in bbnsm_pwrkey_check_for_events()
56 if (state ^ bbnsm->keystate) { in bbnsm_pwrkey_check_for_events()
57 bbnsm->keystate = state; in bbnsm_pwrkey_check_for_events()
58 input_event(input, EV_KEY, bbnsm->keycode, state); in bbnsm_pwrkey_check_for_events()
60 pm_relax(bbnsm->input->dev.parent); in bbnsm_pwrkey_check_for_events()
65 mod_timer(&bbnsm->check_timer, in bbnsm_pwrkey_check_for_events()
72 struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev); in bbnsm_pwrkey_interrupt() local
75 regmap_read(bbnsm->regmap, BBNSM_EVENTS, &event); in bbnsm_pwrkey_interrupt()
79 pm_wakeup_event(bbnsm->input->dev.parent, 0); in bbnsm_pwrkey_interrupt()
81 mod_timer(&bbnsm->check_timer, in bbnsm_pwrkey_interrupt()
85 regmap_write(bbnsm->regmap, BBNSM_EVENTS, BBNSM_BTN_OFF); in bbnsm_pwrkey_interrupt()
92 struct bbnsm_pwrkey *bbnsm = pdata; in bbnsm_pwrkey_act() local
94 timer_shutdown_sync(&bbnsm->check_timer); in bbnsm_pwrkey_act()
99 struct bbnsm_pwrkey *bbnsm; in bbnsm_pwrkey_probe() local
104 bbnsm = devm_kzalloc(&pdev->dev, sizeof(*bbnsm), GFP_KERNEL); in bbnsm_pwrkey_probe()
105 if (!bbnsm) in bbnsm_pwrkey_probe()
108 bbnsm->regmap = syscon_node_to_regmap(np->parent); in bbnsm_pwrkey_probe()
109 if (IS_ERR(bbnsm->regmap)) { in bbnsm_pwrkey_probe()
110 dev_err(&pdev->dev, "bbnsm pwerkey get regmap failed\n"); in bbnsm_pwrkey_probe()
111 return PTR_ERR(bbnsm->regmap); in bbnsm_pwrkey_probe()
115 &bbnsm->keycode)) { in bbnsm_pwrkey_probe()
116 bbnsm->keycode = KEY_POWER; in bbnsm_pwrkey_probe()
120 bbnsm->irq = platform_get_irq(pdev, 0); in bbnsm_pwrkey_probe()
121 if (bbnsm->irq < 0) in bbnsm_pwrkey_probe()
124 /* config the BBNSM power related register */ in bbnsm_pwrkey_probe()
125 regmap_update_bits(bbnsm->regmap, BBNSM_CTRL, BBNSM_DP_EN, BBNSM_DP_EN); in bbnsm_pwrkey_probe()
128 regmap_write_bits(bbnsm->regmap, BBNSM_EVENTS, BBNSM_PWRKEY_EVENTS, in bbnsm_pwrkey_probe()
131 timer_setup(&bbnsm->check_timer, bbnsm_pwrkey_check_for_events, 0); in bbnsm_pwrkey_probe()
140 input->phys = "bbnsm-pwrkey/input0"; in bbnsm_pwrkey_probe()
143 input_set_capability(input, EV_KEY, bbnsm->keycode); in bbnsm_pwrkey_probe()
146 error = devm_add_action(&pdev->dev, bbnsm_pwrkey_act, bbnsm); in bbnsm_pwrkey_probe()
152 bbnsm->input = input; in bbnsm_pwrkey_probe()
153 platform_set_drvdata(pdev, bbnsm); in bbnsm_pwrkey_probe()
155 error = devm_request_irq(&pdev->dev, bbnsm->irq, bbnsm_pwrkey_interrupt, in bbnsm_pwrkey_probe()
169 error = dev_pm_set_wake_irq(&pdev->dev, bbnsm->irq); in bbnsm_pwrkey_probe()
177 { .compatible = "nxp,imx93-bbnsm-pwrkey" },
192 MODULE_DESCRIPTION("NXP bbnsm power key Driver");