User:Uli/Tests:PFC-bias

This describes a method for testing pin control driver bias setting functionality. It uses the R-Car H3 SoC and Salvator-X board as an example.

PFC bias debug interface
The pin control framework does not provide a user space interface for controlling pin bias. This patch adds a simple interface to debugfs, the use of which is described below.

Test procedure
The following steps can be taken to verify that a pin control driver's bias setting code works as expected.
 * 1) Find an GPIO pin on the SoC and board that is not connected to anything. (Example: pin GP6_21 is not used on the Salvator-X board; all further examples also refer that board.)
 * 2) Check the DTS file of the board to find out which controller is handling this pin. (For GP6_21, that is gpio6 at 0xe6055400.)
 * 3) Go to the /sys/class/gpio directory and check which link points to this GPIO controller (gpio@e6055400 points to gpiochip361.)
 * 4) Calculate GPIO subsystem pin number by adding the base (361) to the pin number (21) and write that number to /sys/class/gpio/export.
 * 5) Go to the newly created GPIO pin directory (/sys/class/gpio/gpio382</tt>).
 * 6) Make sure the "direction</tt>" property of the pin is set to "in</tt>".
 * 7) Look at the pin control driver code and find out how it calculates the pin index. (For the sh-pfc driver, the formula is "bank * 32 + pin</tt>", resulting in 213 for GP6_21</tt>.)
 * 8) Ensure that debugfs is mounted at /sys/kernel/debug</tt>.
 * 9) Tell the pin control driver to to enable pull-down:
 * 10) Check the "value</tt>" property, it should be "0</tt>".
 * 11) Enable pull-up instead:
 * 12) Check the "value</tt>" property, it should be "1</tt>".