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

Fix detection of Pine64 devices #280

Merged
merged 1 commit into from
Feb 15, 2023
Merged

Conversation

shulltronics
Copy link
Contributor

@shulltronics shulltronics commented Feb 15, 2023

Hi Adafruit devs :)

I'm working with a Pine64 Pinephone, and noticed that PlatformDetect was identifying my device as a PINE64 single-board computer. I started looking into the logic and noticed a few things:

  • There are constants defined for multiple Pine64 devices, including Pinephone, Pinebook, Pine64, PineH64, and Sopine.
  • The logic in the detector reads the string from /proc/device-tree/model and sets the board id based on whether that string contains some substring.
  • My Pinephone (running an Arch Linux distro, but also double checked this with the Manjaro distro it shipped with) has the model string Pine64 PinePhone (1.2). The way the if-elif statement is structured caused the board id to always be PINE64. I changed the structure to work for my device, but my change will likely break this for a Pine64 SBC.

Perhaps someone could give me some ideas about how to redo the logic to be generic for all Pine64 device? It would be helpful to see the contents of /proc/device-tree/model for all the Pine64 devices that PlatformDetect supports. One idea might be to compare only on the second word of the model name.

Next up is PR Blinka to include the PinePhone. Thanks!

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

This makes sense. Looks good.

@makermelissa makermelissa merged commit a3371ad into adafruit:main Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants