Lines Matching +full:pmic +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0-only
34 * max77620_thermal_read_temp: Read PMIC die temperatue.
35 * @data: Device specific data.
38 * The actual temperature of PMIC die is not available from PMIC.
39 * PMIC only tells the status if it has crossed or not the threshold level
42 * else 120degC or 140deG based on the PMIC die temp threshold status.
53 ret = regmap_read(mtherm->rmap, MAX77620_REG_STATLBT, &val); in max77620_thermal_read_temp()
55 dev_err(mtherm->dev, "Failed to read STATLBT: %d\n", ret); in max77620_thermal_read_temp()
77 if (irq == mtherm->irq_tjalarm1) in max77620_thermal_irq()
78 dev_warn(mtherm->dev, "Junction Temp Alarm1(120C) occurred\n"); in max77620_thermal_irq()
79 else if (irq == mtherm->irq_tjalarm2) in max77620_thermal_irq()
80 dev_crit(mtherm->dev, "Junction Temp Alarm2(140C) occurred\n"); in max77620_thermal_irq()
82 thermal_zone_device_update(mtherm->tz_device, in max77620_thermal_irq()
93 mtherm = devm_kzalloc(&pdev->dev, sizeof(*mtherm), GFP_KERNEL); in max77620_thermal_probe()
95 return -ENOMEM; in max77620_thermal_probe()
97 mtherm->irq_tjalarm1 = platform_get_irq(pdev, 0); in max77620_thermal_probe()
98 mtherm->irq_tjalarm2 = platform_get_irq(pdev, 1); in max77620_thermal_probe()
99 if ((mtherm->irq_tjalarm1 < 0) || (mtherm->irq_tjalarm2 < 0)) { in max77620_thermal_probe()
100 dev_err(&pdev->dev, "Alarm irq number not available\n"); in max77620_thermal_probe()
101 return -EINVAL; in max77620_thermal_probe()
104 mtherm->dev = &pdev->dev; in max77620_thermal_probe()
105 mtherm->rmap = dev_get_regmap(pdev->dev.parent, NULL); in max77620_thermal_probe()
106 if (!mtherm->rmap) { in max77620_thermal_probe()
107 dev_err(&pdev->dev, "Failed to get parent regmap\n"); in max77620_thermal_probe()
108 return -ENODEV; in max77620_thermal_probe()
113 * reprobe or on platform-device release. in max77620_thermal_probe()
115 device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); in max77620_thermal_probe()
117 mtherm->tz_device = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, in max77620_thermal_probe()
119 if (IS_ERR(mtherm->tz_device)) { in max77620_thermal_probe()
120 ret = PTR_ERR(mtherm->tz_device); in max77620_thermal_probe()
121 dev_err(&pdev->dev, "Failed to register thermal zone: %d\n", in max77620_thermal_probe()
126 ret = devm_request_threaded_irq(&pdev->dev, mtherm->irq_tjalarm1, NULL, in max77620_thermal_probe()
129 dev_name(&pdev->dev), mtherm); in max77620_thermal_probe()
131 dev_err(&pdev->dev, "Failed to request irq1: %d\n", ret); in max77620_thermal_probe()
135 ret = devm_request_threaded_irq(&pdev->dev, mtherm->irq_tjalarm2, NULL, in max77620_thermal_probe()
138 dev_name(&pdev->dev), mtherm); in max77620_thermal_probe()
140 dev_err(&pdev->dev, "Failed to request irq2: %d\n", ret); in max77620_thermal_probe()
150 { .name = "max77620-thermal", },
157 .name = "max77620-thermal",