-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add support for PiJuice HAT #730
Conversation
Add pijuice driver
Update the driver Makefile.am to add pijuice driver to the LINUX_I2C_DRIVERLIST
Check for both the i2c-tools 3.x and 4.x include files (i2c-dev.h/smbus.h) and set flags accordingly. Link with the i2c library file from i2c-tools 4.x if it is available.
Update asem.c to complie cleanly by adding an include for <sys/ioctl.h>
Clean up the upsdebugX() labels Pull the conditional I2C support code closer to the includes block Don't report battery temp as UPS temp Warn if we adjust shutdown_delay
Accommodate one more variation of SMBUS/I2C support where both the headers and the libraries exist and are usable.
Check for I2C_FUNC_I2C to avoid errors caused by conflicts between linux/i2c-dev.h and linux/i2c.h
@aander07 thanks for submitting this - looks good at first glance! I would like to dive into the code a little more, but just wanted to let you know that someone has taken a look. One thing about the @aquette / @zykh @jimklimov: other thoughts? I know we had proposed the |
@clepple, I've yet to look at this... but, speaking of the driver name, in my opinion we should stand by our previous stance (not that I'm going to push for a name change, if there's no consensus over that, though). |
Removing the Let me know which direction that you want to go re: naming, and I'll take care of both of these items at the same time. |
Looks OK to me on the structural side :) Given that we have now two consumers of I2C, would it make sense to refactor the fallback routine definitions in Also, with nested |
hi @aander07 |
Hi @aander07
If this is the only missing thing, could you try adding it? Would be great having support for the PiJuice merged ;-) |
If only the presence of manpage is the show stopper, I posted aander07#1 to get one (ripped off asem.txt) and also to clean up some whitespaces in the new source. |
How can i install this patch? |
At the moment - build NUT from the master branch and it should be there.
Not part of an official release number yet, none were done since this
recent merge.
…On Tue, Feb 16, 2021, 14:26 patricknooijen ***@***.***> wrote:
How can i install this patch?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#730 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFCRFWXE4XCEEOPRLYLS7JXB7ANCNFSM4IWK3XYQ>
.
|
pi@retropie:/lib/nut $ sudo upsdrvctl start Did i miss something? Compiled from master branch. |
@patricknooijen be sure that you have all of the necessary i2c development headers installed. Here is an example of a Buildbot system that doesn't have everything:
From a quick look at this PR, you will probably need the last line to end in "yes". I don't have first-hand experience with recent i2c support, so please check the first comment in this PR for more information on what to search for. If you are following one of the wiki pages for building, it is possible that the instructions do not include the dependencies for all of the drivers. Let us know what works, and someone can update them. |
I had a go at compiling from source, I have to say it was remarkably easy! Thank you for that. After installing the header files with |
This PR adds support for the PiJuice HAT (https://uk.pi-supply.com/products/pijuice-standard)
Included with this patch is more robust autoconf support for the 3.x and 4.x releases of the i2c-tools library, with the 4.x release adding the user space include file name i2c/smbus.h to resolve a user/kernel include file naming conflict. This will make it easier for future I2C drivers to handle both build environments.
I also fixed a compile warning in the ASEM driver where it needed sys/ioctl.h for a constant, but I did not update that driver to use the new I2C definitions since I do not have the hardware to test that it would not break anything.
Configuration: