Lines Matching refs:rk808
454 struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client); in rk808_pm_power_off() local
456 switch (rk808->variant) { in rk808_pm_power_off()
472 ret = regmap_update_bits(rk808->regmap, reg, bit, bit); in rk808_pm_power_off()
479 struct rk808 *rk808 = i2c_get_clientdata(client); in rk8xx_shutdown() local
482 switch (rk808->variant) { in rk8xx_shutdown()
484 ret = regmap_update_bits(rk808->regmap, in rk8xx_shutdown()
491 ret = regmap_update_bits(rk808->regmap, in rk8xx_shutdown()
518 struct rk808 *rk808; in rk808_probe() local
528 rk808 = devm_kzalloc(&client->dev, sizeof(*rk808), GFP_KERNEL); in rk808_probe()
529 if (!rk808) in rk808_probe()
556 rk808->variant = ((msb << 8) | lsb) & RK8XX_ID_MSK; in rk808_probe()
557 dev_info(&client->dev, "chip id: 0x%x\n", (unsigned int)rk808->variant); in rk808_probe()
559 switch (rk808->variant) { in rk808_probe()
561 rk808->regmap_cfg = &rk805_regmap_config; in rk808_probe()
562 rk808->regmap_irq_chip = &rk805_irq_chip; in rk808_probe()
569 rk808->regmap_cfg = &rk808_regmap_config; in rk808_probe()
570 rk808->regmap_irq_chip = &rk808_irq_chip; in rk808_probe()
577 rk808->regmap_cfg = &rk818_regmap_config; in rk808_probe()
578 rk808->regmap_irq_chip = &rk818_irq_chip; in rk808_probe()
586 rk808->regmap_cfg = &rk817_regmap_config; in rk808_probe()
587 rk808->regmap_irq_chip = &rk817_irq_chip; in rk808_probe()
595 rk808->variant); in rk808_probe()
599 rk808->i2c = client; in rk808_probe()
600 i2c_set_clientdata(client, rk808); in rk808_probe()
602 rk808->regmap = devm_regmap_init_i2c(client, rk808->regmap_cfg); in rk808_probe()
603 if (IS_ERR(rk808->regmap)) { in rk808_probe()
605 return PTR_ERR(rk808->regmap); in rk808_probe()
613 ret = regmap_add_irq_chip(rk808->regmap, client->irq, in rk808_probe()
615 rk808->regmap_irq_chip, &rk808->irq_data); in rk808_probe()
622 ret = regmap_update_bits(rk808->regmap, in rk808_probe()
636 regmap_irq_get_domain(rk808->irq_data)); in rk808_probe()
650 regmap_del_irq_chip(client->irq, rk808->irq_data); in rk808_probe()
656 struct rk808 *rk808 = i2c_get_clientdata(client); in rk808_remove() local
658 regmap_del_irq_chip(client->irq, rk808->irq_data); in rk808_remove()
672 struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev)); in rk8xx_suspend() local
675 switch (rk808->variant) { in rk8xx_suspend()
677 ret = regmap_update_bits(rk808->regmap, in rk8xx_suspend()
684 ret = regmap_update_bits(rk808->regmap, in rk8xx_suspend()
698 struct rk808 *rk808 = i2c_get_clientdata(to_i2c_client(dev)); in rk8xx_resume() local
701 switch (rk808->variant) { in rk8xx_resume()
704 ret = regmap_update_bits(rk808->regmap, in rk8xx_resume()