Skip to main content
of_device_id is a better search choice than the macro that uses it
Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for the users of the MODULE_DEVICE_TABLE macro (ignore the fact that the search tool's parser misclassifies the usage as being a prototype). You're interested in the invocations where the first argument is offiles that contain of_device_id (i.e. OpenFirmwareOpenFirmware device identifier) for examples of how to match specific devices.

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for the users of the MODULE_DEVICE_TABLE macro (ignore the fact that the search tool's parser misclassifies the usage as being a prototype). You're interested in the invocations where the first argument is of (i.e. OpenFirmware).

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for files that contain of_device_id (OpenFirmware device identifier) for examples of how to match specific devices.

MODULE_DEVICE_TABLE(of, values)
Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for the users of the MODULE_DEVICE_TABLE macro (ignore the fact that the search tool's parser misclassifies the usage as being a prototype). You're interested in the invocations where the first argument is of (i.e. OpenFirmware).

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for the users of the MODULE_DEVICE_TABLE macro (ignore the fact that the search tool's parser misclassifies the usage as being a prototype).

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for the users of the MODULE_DEVICE_TABLE macro (ignore the fact that the search tool's parser misclassifies the usage as being a prototype). You're interested in the invocations where the first argument is of (i.e. OpenFirmware).

Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

As you say, the device matching doesn't work properly, and doesn't allow you to use more than one of these encoders at once.

What you need to do is to match against Device Tree entries. This is a subject too big for a single answer, but thankfully there's a good introduction to Device Trees on the Raspberry Pi site that shows how to create DT overlays.

For the kernel side of things, the best advice is to crib from existing modules that match against DT entries. Look for the users of the MODULE_DEVICE_TABLE macro (ignore the fact that the search tool's parser misclassifies the usage as being a prototype).