greybus: arche-apb-ctrl: Introduce ara,init-disable property for APB
authorVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Fri, 12 Feb 2016 20:34:14 +0000 (02:04 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 15 Feb 2016 21:18:40 +0000 (13:18 -0800)
commitaf3aae10f16f05acba27294bc1ae234f3cb61a61
treec759b3717f56283ca9b17eacaa55512685b7d08c
parent33d76291073dd9408055a23cd96a23c375944377
greybus: arche-apb-ctrl: Introduce ara,init-disable property for APB

New DT property "ara,init-disable" will allow user to disable
APB1 or APB2 during boot and enable it only when needed through
command prompt via sysfs interface.

 - To disable APB2 during boot, specify "ara,init-disable" property in
   respective APB node.

 - How to check the state
   # cat /sys/devices/arche_platform.*/apb*/state

   It should be 'off', if 'ara,init-disable' enabled in DT.

 - During runtime if user/developer desired to enable APB2 (strictly and
   only for development purpose) then respective APB can be enabled
   through,

   # echo active > /sys/devices/arche_platform.*/apb*/state

Note:
  - If APB device is in 'off,disabled' state, then no state transitions
    are permitted.
  - User/developer must first activate APB device

    # echo active > /sys/devices/arche_platform.*/apb*/state

    This will clear the 'init-disable' flag and allow state transition
    from here onwards.
    Note that, 'off,disabled' is only indicative state and is only
    applicable during init/boot.

Testing Done: Tested on EVT1.2 and DB3.5 platform

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/arche-apb-ctrl.c