Re: Composite PCI devices in FreeBSD (mfd in Linux)

From: Anthony Jenkins <Scoobi_doo_at_yahoo.com>
Date: Wed, 19 Dec 2018 14:35:14 -0500
On 12/19/18 10:41 AM, Anthony Jenkins wrote:
> [snip]
>
> I'm not feeling too confident about the condition of the FreeBSD ig4 
> driver; the PCI attach code was calling pci_alloc_msi() wrong, passing 
> a pointer to the rid (0) instead of a pointer to a count variable, and 
> not passing bus_alloc_resource_any() an IRQ rid > 0 if it has an MSI.  
> I'd be happy(er) if ig4 created a /dev/iic0 node - I figured iicbus(4) 
> took care of all that...
>
> https://github.com/ScoobiFreeBSD/freebsd-intel-lpss
>
Found it!  I didn't declare ig4_iic to include the ig4_lpss as a 
sub-device.  Now it at least /looks/ like I'm getting I2C devices found 
on both my DesignWare I2C busses.

diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c
index 6bbe417..34c1adb 100644
--- a/sys/dev/ichiic/ig4_iic.c
+++ b/sys/dev/ichiic/ig4_iic.c
_at__at_ -802,3 +802,4 _at__at_ ig4iic_dump(ig4iic_softc_t *sc)

  DRIVER_MODULE(iicbus, ig4iic_acpi, iicbus_driver, iicbus_devclass, 
NULL, NULL);
  DRIVER_MODULE(iicbus, ig4iic_pci, iicbus_driver, iicbus_devclass, 
NULL, NULL);
+DRIVER_MODULE(iicbus, ig4iic_lpss, iicbus_driver, iicbus_devclass, 
NULL, NULL);

ajenkins_at_ajenkins-delllaptop ~/Projects/freebsd-intel-lpss (master)
$ ls /dev/ii*
/dev/iic0  /dev/iic1

ajenkins_at_ajenkins-delllaptop ~/Projects/freebsd-intel-lpss (master)
$ for i2cbus in iic0 iic1; do sudo i2c -s -f "/dev/${i2cbus}"; done
Hardware may not support START/STOP scanning; trying less-reliable read 
method.
Scanning I2C devices on /dev/iic0: 0a
Hardware may not support START/STOP scanning; trying less-reliable read 
method.
Scanning I2C devices on /dev/iic1: 2c

Anthony
Received on Wed Dec 19 2018 - 18:35:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:19 UTC