Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: sensor: Add PM support to LM75 digital temperature sensor #61167

Merged

Conversation

semihalf-jakiela-albert
Copy link
Contributor

Add support for device power management. When the sensor is not powered, the fetch function will fail. When the sensor is not connected to a power domain, it will behave as usual.

@@ -62,14 +64,27 @@ static int lm75_sample_fetch(const struct device *dev,
{
struct lm75_data *data = dev->data;
const struct lm75_config *cfg = dev->config;
int rc = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the initializer, you set this again literally on the next line.

drivers/sensor/lm75/lm75.c Show resolved Hide resolved
fabiobaltieri
fabiobaltieri previously approved these changes Aug 4, 2023
@semihalf-jakiela-albert
Copy link
Contributor Author

I've looked at other sensors, and every sensor uses pm_device_state_get, so I changed pm_device_runtime_get/put to pm_device_state_get.

Add support for device power management. When the sensor
is not powered, the fetch function will fail. When the
sensor is not connected to a power domain, it will behave
as usual.

Signed-off-by: Albert Jakieła <aja@semihalf.com>
@fabiobaltieri
Copy link
Member

@MaureenHelm ping

@MaureenHelm MaureenHelm merged commit dd4ef7d into zephyrproject-rtos:main Sep 5, 2023
15 checks passed
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @semihalf-jakiela-albert!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants