is kernel module an ideal way to access a device registers?

116 Views Asked by At

I have a power management device (PF1550) in an I.MX6ULL embedded linux platform and its registers are configured in the uboot once. I want to have something to pull its registers in the firmware right after boot up. Is kernel Module a good way to do this or there are simpler ways?

Thanks for your help in advance!

1

There are 1 best solutions below

0
Livius On

NXP PF1550 has an I2C interface, so I can believe it is connected to your NXP i.MX6ULL SoC. If yes, you can probe i2c-dev userspace driver, and you can read/write any PF1550's reg config via /dev/i2c-X adapter. I suggest to use python-periphery to test it.

By the way, it seems to me that, there was made a patch for support PF1550 via I2C in Linux kernel, but I can not find it in the mainline and in NXP's Linux kernel, maybe it is still not approved. https://lore.kernel.org/lkml/[email protected]/