LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-29-2023, 10:07 PM   #1
zik
LQ Newbie
 
Registered: Aug 2023
Posts: 2

Rep: Reputation: 0
How to configure an embedded linux device with power-cyclable hardware?


I'm working on an embedded linux device which has a number of I2C-based GPIO expander chips. All the internal gpio expanders are powered on with the rest of the system but one gpio expander is on an external plug-in card which has to be powered on by setting an output on one of the internal gpio expanders. All the internal and external gpio expanders are the same type - pcal9535.

I've created a device tree which successfully brings up all the internal gpio expanders but I'm having problems with the external one.

To power the system on I need to have the gpio-pca953x driver come up first so all the internal expanders come up. Then I can control the output to turn on the external gpio expander. But once I've done that it's too late for the driver to probe the external expander because the probe already failed when I brought the driver up with its power turned off. And if I unload the gpio-pca953x driver entirely and reload it all the other gpios are also affected which causes problems as I'll explain later. So I really want to probe just the external expander again without affecting the internal ones.

This hardware design is intended to allow us to power cycle the external module if a failure is detected. Since the device is unattended there's no option to have a human power cycle it. Ideally we'd power cycle the external module via the power control line and then bring the drivers up again. But since the driver is shared between external and internal expanders I can't see a way to re-probe just the external expander.

FWIW the CPU is a Jetson TX2 NX module and the application is a vehicle telemetry device for fleets.

Surely this problem occurs on devices with hotplugged hardware too?

Does anyone have a good solution?

Last edited by zik; 08-30-2023 at 12:49 AM.
 
Old 08-30-2023, 02:40 AM   #2
zik
LQ Newbie
 
Registered: Aug 2023
Posts: 2

Original Poster
Rep: Reputation: 0
Solved: reading through the pca953x driver it seems they anticipated this and support it to some degree just using standard regulator settings.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Power off USB storage device/port to avoid power consumption johndir Linux - Hardware 4 11-15-2011 05:04 PM
Power Management not working on embedded MIPS when using /sys/power/state RichardS Programming 1 01-21-2011 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration