Date: Fri, 17 Aug 2018 11:48:22 +0530 From: Rajesh Kumar <rajfbsd@gmail.com> To: freebsd-drivers@freebsd.org, freebsd-hackers@freebsd.org Subject: Need a clarification regarding I2C bus frequency in FreeBSD Message-ID: <CAAO%2BANOXwXAzJt%2BBZez6422jqKjrKPboSe_%2BudnOCWxYqE-=sQ@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi, I am trying to use the I2C designware controller driver available in FreeBSD (ig4_iic.c) in our boards. Is there a clean way, I can set the I2C bus frequency from the controller driver itself, rather than using device hints, FDT, tunables etc., Something like, if the driver is loaded for our boards (identified using the PCI or ACPI ID's), then the frequency of the I2C bus needs to be hardcoded from driver itself. This is to avoid additional configs from the config file. I tried adding a new interface "iicbus_set_frequency" (in line with iicbus_get_frequency) and tried calling that from the ig4 driver after the "iicbus" child is added. But, iicbus instance is created only after ig4 driver is loaded. So, calling iicbus_set_frequency after child addition leads to system panic (as there is no iicbus softc at this point). Let me know if you need any details. Thanks, Rajesh.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAO%2BANOXwXAzJt%2BBZez6422jqKjrKPboSe_%2BudnOCWxYqE-=sQ>