Lines Matching refs:mcp
157 static void mcp16502_gpio_set_mode(struct mcp16502 *mcp, int mode) in mcp16502_gpio_set_mode() argument
161 gpiod_set_value(mcp->lpm, 0); in mcp16502_gpio_set_mode()
165 gpiod_set_value(mcp->lpm, 1); in mcp16502_gpio_set_mode()
508 struct mcp16502 *mcp; in mcp16502_probe() local
515 mcp = devm_kzalloc(dev, sizeof(*mcp), GFP_KERNEL); in mcp16502_probe()
516 if (!mcp) in mcp16502_probe()
526 i2c_set_clientdata(client, mcp); in mcp16502_probe()
528 config.driver_data = mcp; in mcp16502_probe()
530 mcp->lpm = devm_gpiod_get_optional(dev, "lpm", GPIOD_OUT_LOW); in mcp16502_probe()
531 if (IS_ERR(mcp->lpm)) { in mcp16502_probe()
532 dev_err(dev, "failed to get lpm pin: %ld\n", PTR_ERR(mcp->lpm)); in mcp16502_probe()
533 return PTR_ERR(mcp->lpm); in mcp16502_probe()
546 mcp16502_gpio_set_mode(mcp, MCP16502_OPMODE_ACTIVE); in mcp16502_probe()
555 struct mcp16502 *mcp = i2c_get_clientdata(client); in mcp16502_suspend_noirq() local
557 mcp16502_gpio_set_mode(mcp, MCP16502_OPMODE_LPM); in mcp16502_suspend_noirq()
565 struct mcp16502 *mcp = i2c_get_clientdata(client); in mcp16502_resume_noirq() local
567 mcp16502_gpio_set_mode(mcp, MCP16502_OPMODE_ACTIVE); in mcp16502_resume_noirq()