Skip to contentSkip to conversation

I2C: can't detect Adafruit Mini I2C Gamepad on Linux - other devices detected

DISCUSSION Michael Opdenacker 2 participants 5 messages Apr 11, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Anshul

I contact you as the maintainer for the Adafruit Mini I2C Gamepad driver.

I'm trying to use the Adafruit Seesaw I2C gamepad in my embedded Linux training courses, to demonstrate driving I2C hardware, and the gamepad would be perfect to play an ASCII Pac-Man clone (https://github.com/michaelopdenacker/myman <https://github.com/michaelopdenacker/myman>).

Even before your driver is loaded, the device has to be detected. My problem is the gamepad is never detected on Linux (running "i2cdetect -r <num>"), while other I2C devices connected to the same bus are, proving that the bus is correctly enabled. This happens on all these boards running recent kernels:
- BeaglePlay (Linux 6.14.2!)
- BeagleBone Black
- Raspberry Pi5

I double checked my gamepads (I have 4 of them) and wires: they work fine on Arduino Uno.

Any clue why none of my 4 gamepads are never detected while two other types of I2C devices are detected on the same bus, and the same gamepads work on Arduino Uno?

Maybe something stupid but I'm running out of clues...

You can also have a look at the questions I asked on the Adafruit forums and the pictures I shared:
https://forums.adafruit.com/viewtopic.php?p=1052577#p1052577

Cheers
Michael.

Signature · 4 lines
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/
#1 lore raw

Greetings

Quoted 13 lines · Michael Opdenacker

Hi Anshul

I contact you as the maintainer for the Adafruit Mini I2C Gamepad driver.

I'm trying to use the Adafruit Seesaw I2C gamepad in my embedded Linux training courses, to demonstrate driving I2C hardware, and the gamepad would be perfect to play an ASCII Pac-Man clone (https://github.com/michaelopdenacker/myman <https://github.com/michaelopdenacker/myman>).

Even before your driver is loaded, the device has to be detected. My problem is the gamepad is never detected on Linux (running "i2cdetect -r <num>"), while other I2C devices connected to the same bus are,
proving that the bus is correctly enabled. This happens on all these boards running recent kernels:
- BeaglePlay (Linux 6.14.2!)
- BeagleBone Black
- Raspberry Pi5

Quoted 3 lines

I double checked my gamepads (I have 4 of them) and wires: they work fine on Arduino Uno.

Any clue why none of my 4 gamepads are never detected while two other types of I2C devices are detected on the same bus, and the same gamepads work on Arduino Uno?

Some progress here... On BeaglePlay, which is my primary target, I realized that if I declare the device in the device tree AND load the driver for the device, then the device seems to work fine. When I press the buttons, I get data in /dev/input/event<x>.

Plus "i2cdetect -r <num>" shows the device as UU for address 0x50, as usually happens with a driver is loaded.

I thought that connected I2C devices always showed in i2cdetect output, whether they are declared in the device tree and have a driver or not.

Cheers
Michael.

Signature · 4 lines
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/
#2 lore raw
Quoted 3 lines

Plus "i2cdetect -r <num>" shows the device as UU for address 0x50, as usually happens with a driver is loaded.

Always. The address is blocked for userspace in any case.

Quoted 2 lines

I thought that connected I2C devices always showed in i2cdetect output, whether they are declared in the device tree and have a driver or not.

This is a valid expectation. Since you used 'i2cdetect -r', it means that the device does not react to the read_byte method. Very strange (if not even against the specs). Did you try without '-r' to use SMBUS_QUICK? What driver are we talking about anyhow?

#3 lore raw

Hi Wolfram

Thanks for your help!

Quoted 10 lines · Wolfram Sang
Quoted 2 lines

Plus "i2cdetect -r <num>" shows the device as UU for address 0x50, as usually happens with a driver is loaded.

Always. The address is blocked for userspace in any case.

Quoted 2 lines

I thought that connected I2C devices always showed in i2cdetect output, whether they are declared in the device tree and have a driver or not.

This is a valid expectation. Since you used 'i2cdetect -r', it means that the device does not react to the read_byte method. Very strange (if not even against the specs). Did you try without '-r' to use SMBUS_QUICK? What driver are we talking about anyhow?

Without the driver loaded, I get this...

~ # i2cdetect 5
i2cdetect: warning: can't use SMBus quick write command, will skip some addresses
i2cdetect: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:
10:
20:
30: -- -- -- -- -- -- -- --
40:
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60:
70:
~ #
~ # i2cdetect -r 5
i2cdetect: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

When the driver is loaded, there's UU as expected for address 0x50.

The driver is drivers/input/joystick/adafruit-seesaw.c Cheers
Michael.

Signature · 4 lines
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/