dhruvvyas90
Posts: 25
Joined: Thu Nov 21, 2013 2:36 pm

Determining Rpi revision in kernel driver module.

Wed Mar 04, 2015 1:07 pm

Hi,

I am sort of new to driver development in Linux. I'm trying to write a driver for an I2C device and as it turns out, Rpi revision 1 uses i2c bus 0 and revision 2 uses i2c bus 1. I was wondering if there is a way to determine Rpi revision run time or compile time in a kernel module (both are fine).

Thanks in advance.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6084
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Determining Rpi revision in kernel driver module.

Wed Mar 04, 2015 3:11 pm

The 'simple' way is to check the board rev. I think there's a nicer way to do it using device tree (but I don't know what that is).

Return to “Beginners”