chipcap2.c (f16fb6d23b68699eed97fe1edee0d8eecde14a67) chipcap2.c (efd49b8eef659e0aa962ec1dbf18740e34735219)
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * cc2.c - Support for the Amphenol ChipCap 2 relative humidity, temperature sensor
4 *
5 * Part numbers supported:
6 * CC2D23, CC2D23S, CC2D25, CC2D25S, CC2D33, CC2D33S, CC2D35, CC2D35S
7 *
8 * Author: Javier Carrasco <javier.carrasco.cruz@gmail.com>

--- 656 unchanged lines hidden (view full) ---

665 dev_name(dev), data);
666 }
667
668 return ret;
669}
670
671static int cc2_request_alarm_irqs(struct cc2_data *data, struct device *dev)
672{
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * cc2.c - Support for the Amphenol ChipCap 2 relative humidity, temperature sensor
4 *
5 * Part numbers supported:
6 * CC2D23, CC2D23S, CC2D25, CC2D25S, CC2D33, CC2D33S, CC2D35, CC2D35S
7 *
8 * Author: Javier Carrasco <javier.carrasco.cruz@gmail.com>

--- 656 unchanged lines hidden (view full) ---

665 dev_name(dev), data);
666 }
667
668 return ret;
669}
670
671static int cc2_request_alarm_irqs(struct cc2_data *data, struct device *dev)
672{
673 int ret;
673 int ret = 0;
674
675 data->irq_low = fwnode_irq_get_byname(dev_fwnode(dev), "low");
676 if (data->irq_low > 0) {
677 ret = devm_request_threaded_irq(dev, data->irq_low, NULL,
678 cc2_low_interrupt,
679 IRQF_ONESHOT |
680 IRQF_TRIGGER_RISING,
681 dev_name(dev), data);
674
675 data->irq_low = fwnode_irq_get_byname(dev_fwnode(dev), "low");
676 if (data->irq_low > 0) {
677 ret = devm_request_threaded_irq(dev, data->irq_low, NULL,
678 cc2_low_interrupt,
679 IRQF_ONESHOT |
680 IRQF_TRIGGER_RISING,
681 dev_name(dev), data);
682 if (!ret)
683 data->rh_alarm.low_alarm_visible = true;
682 if (ret)
683 return ret;
684
685 data->rh_alarm.low_alarm_visible = true;
684 }
685
686 data->irq_high = fwnode_irq_get_byname(dev_fwnode(dev), "high");
687 if (data->irq_high > 0) {
688 ret = devm_request_threaded_irq(dev, data->irq_high, NULL,
689 cc2_high_interrupt,
690 IRQF_ONESHOT |
691 IRQF_TRIGGER_RISING,
692 dev_name(dev), data);
686 }
687
688 data->irq_high = fwnode_irq_get_byname(dev_fwnode(dev), "high");
689 if (data->irq_high > 0) {
690 ret = devm_request_threaded_irq(dev, data->irq_high, NULL,
691 cc2_high_interrupt,
692 IRQF_ONESHOT |
693 IRQF_TRIGGER_RISING,
694 dev_name(dev), data);
693 if (!ret)
694 data->rh_alarm.high_alarm_visible = true;
695 if (ret)
696 return ret;
697
698 data->rh_alarm.high_alarm_visible = true;
695 }
696
697 return ret;
698}
699
700static const struct hwmon_channel_info *cc2_info[] = {
701 HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
702 HWMON_CHANNEL_INFO(humidity, HWMON_H_INPUT | HWMON_H_MIN | HWMON_H_MAX |

--- 116 unchanged lines hidden ---
699 }
700
701 return ret;
702}
703
704static const struct hwmon_channel_info *cc2_info[] = {
705 HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
706 HWMON_CHANNEL_INFO(humidity, HWMON_H_INPUT | HWMON_H_MIN | HWMON_H_MAX |

--- 116 unchanged lines hidden ---