diff options
author | John Klug <john.klug@multitech.com> | 2022-02-17 18:23:05 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2022-02-17 18:55:00 -0600 |
commit | f18fbc09223234947b22434b5fa7fd684d17f448 (patch) | |
tree | 404be38f1bce48213440535c395b3242f5dbe05a /README | |
parent | 9934194837157908acdf39665a4730d46176eb83 (diff) | |
download | mts-io-f18fbc09223234947b22434b5fa7fd684d17f448.tar.gz mts-io-f18fbc09223234947b22434b5fa7fd684d17f448.tar.bz2 mts-io-f18fbc09223234947b22434b5fa7fd684d17f448.zip |
Unload the driver if platform_driver register fails, add README to explain the history of MTS-IO4.9.1
Diffstat (limited to 'README')
-rw-r--r-- | README | 67 |
1 files changed, 67 insertions, 0 deletions
@@ -15,3 +15,70 @@ the on-board EE-PROM. dev_dbg can be turned on when loading the mts-io driver. See debug/README and debug/etc/modprobe.d/mts-io.conf + +HISTORY: +Before the 4.9 kernel, mLinux used a patch +of the GPIO library to add pull up and pull +down capability to the GPIO flags. + +This patch did not easily fit with +newer kernels. So instead, the pull +up and pull down code was moved todata +device tree and AT91Pincontrol +(for Atmel processors) +from the mts-io driver. + +When the mts-io module was loaded, the +device tree was scanned, and the +pinctrl elements in device tree +associated with the mts-io driver +were loaded. + +Before the 4.9 version of the mts-io +driver, on initial load, the probe +function was executed. The probe +function in the device tree model +of the kernel causes a search +of the device tree and when +an element is found with the appropriate +compatible property, that part of the device tree +is loaded. This caused the attached +pinctrl sections to be read and the pins +configured. + +Because the kernel doc suggests adding +a number at the end of a node name, mts-io-0 +was chosen. + +Because the mts-io driver had always allocated +its own platform, it already had a +platform called mts-io. Because of this, we +did a platform_driver_register, followed +immediately by a platform_driver_unregister. +This allowed us to set up the pins using +device tree and allowed us to keep all +the old code that created and used the +platform driver with a minimum of changes. +The device tree used mts-io-0 for the +mts-io driver node which became +/sys/devices/platform/mts-io-0. The +mts-io driver continues to use +/sys/devices/platform/mts-io. + +Now at the 4.9 mts-io version level, +an attempt is made to move towards using +the gpio connection-id's from the +newer gpiod library. These connection-ids +are referred to as "names" in device tree +documentation. It is no longer possible +to free the platform loaded by +platform_driver_register, because +we need to use these device tree +entries later in the driver. + +GPIO pins are then be attached through the GPIO +descriptor found by making a call to +kernel functions like devm_gpiod_get_optional(), +which has a connection-ID as its second +parameter. + |