[PORT FROM R2] hsi_ffl_tty.c: adding some /sys/module interface to manage modem reset
BZ: 19623
This patch is adding two sysFS interfaces aimed at managing modem reset and TTY
interface hang-up:
- /sys/module/hsi_ffl_tty/parameters/reset_modem for resetting the modem and
querying its reset status;
- /sys/module/hsi_ffl_tty/parameters/hangup_reasons for accessing and clearing
hang-up reasons.
The /sys/module/hsi_ffl_tty/parameters/reset_modem interface is exporting some
decimal data consisting of a bitfield of 1 bit per TTY interface (bit 0 for
ttyIFX0, bit 1 for ttyIFX1...) where:
- when written to 1 is resetting the corresponding modem (the one attached to
the TTY interface);
- when read to 1 is signalling that the corresponding modem is still resetting,
as it did not successfully managed any TX or RX transaction.
The /sys/module/hsi_ffl_tty/parameters/hangup_reasons interface is exporting
some decimal data consisting of a bitfield of 1 nibble (4-bits) per TTY
interface (bit0 to 3 for ttyIFX0, bit 4 to 7 for ttyIFX1...) where:
- when read is getting the last hangup reasons of the considered TTY interface
(bit 0 for TX timeout, bit 1 for modem reset and bit 2 for modem core dump);
- when written is clearing the given hangup reasons of the considered TTY
interface (bit 0 to clear TX timeout, bit 1 for modem reset and bit 2 for
modem core dump).
This last interface is different from the related IOCTL, which is working in a
read-to-clear mode. This is no longer the case with this sysFS interface where
the read data shall be written back to clear the hangup reasons. A correct
management would be:
1. read /sys/module/hsi_ffl_tty/parameters/hangup_reasons,
2. write back the read value to acknowledge those hangup reasons and then,
3. perform whatever is necessary to manage the hangup reasons.
See the functions header descriptions for more information regarding those new
interfaces.
Change-Id: I82647742ce6292950cb5216593611146c151c533
Signed-off-by: Olivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Reviewed-on: http://android.intel.com:8080/31415
Reviewed-by: Predon, Frederic <frederic.predon@intel.com>
Reviewed-by: Lebsir, SamiX <samix.lebsir@intel.com>
Tested-by: Lebsir, SamiX <samix.lebsir@intel.com>
Reviewed-by: Lucas, GuillaumeX <guillaumex.lucas@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>