xref: /OK3568_Linux_fs/kernel/Documentation/w1/masters/omap-hdq.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun========================================
2*4882a593SmuzhiyunKernel driver for omap HDQ/1-wire module
3*4882a593Smuzhiyun========================================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunSupported chips:
6*4882a593Smuzhiyun================
7*4882a593SmuzhiyunHDQ/1-wire controller on the TI OMAP 2430/3430 platforms.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunA useful link about HDQ basics:
10*4882a593Smuzhiyun===============================
11*4882a593Smuzhiyunhttp://focus.ti.com/lit/an/slua408a/slua408a.pdf
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunDescription:
14*4882a593Smuzhiyun============
15*4882a593SmuzhiyunThe HDQ/1-Wire module of TI OMAP2430/3430 platforms implement the hardware
16*4882a593Smuzhiyunprotocol of the master functions of the Benchmark HDQ and the Dallas
17*4882a593SmuzhiyunSemiconductor 1-Wire protocols. These protocols use a single wire for
18*4882a593Smuzhiyuncommunication between the master (HDQ/1-Wire controller) and the slave
19*4882a593Smuzhiyun(HDQ/1-Wire external compliant device).
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunA typical application of the HDQ/1-Wire module is the communication with battery
22*4882a593Smuzhiyunmonitor (gas gauge) integrated circuits.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunThe controller supports operation in both HDQ and 1-wire mode. The essential
25*4882a593Smuzhiyundifference between the HDQ and 1-wire mode is how the slave device responds to
26*4882a593Smuzhiyuninitialization pulse.In HDQ mode, the firmware does not require the host to
27*4882a593Smuzhiyuncreate an initialization pulse to the slave.However, the slave can be reset by
28*4882a593Smuzhiyunusing an initialization pulse (also referred to as a break pulse).The slave
29*4882a593Smuzhiyundoes not respond with a presence pulse as it does in the 1-Wire protocol.
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunRemarks:
32*4882a593Smuzhiyun========
33*4882a593SmuzhiyunThe driver (drivers/w1/masters/omap_hdq.c) supports the HDQ mode of the
34*4882a593Smuzhiyuncontroller. In this mode, as we can not read the ID which obeys the W1
35*4882a593Smuzhiyunspec(family:id:crc), a module parameter can be passed to the driver which will
36*4882a593Smuzhiyunbe used to calculate the CRC and pass back an appropriate slave ID to the W1
37*4882a593Smuzhiyuncore.
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunBy default the master driver and the BQ slave i/f
40*4882a593Smuzhiyundriver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1.
41*4882a593SmuzhiyunPlease note to load both the modules with a different ID if required, but note
42*4882a593Smuzhiyunthat the ID used should be same for both master and slave driver loading.
43*4882a593Smuzhiyun
44*4882a593Smuzhiyune.g::
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  insmod omap_hdq.ko W1_ID=2
47*4882a593Smuzhiyun  insmod w1_bq27000.ko F_ID=2
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunThe driver also supports 1-wire mode. In this mode, there is no need to
50*4882a593Smuzhiyunpass slave ID as parameter. The driver will auto-detect slaves connected
51*4882a593Smuzhiyunto the bus using SEARCH_ROM procedure. 1-wire mode can be selected by
52*4882a593Smuzhiyunsetting "ti,mode" property to "1w" in DT (see
53*4882a593SmuzhiyunDocumentation/devicetree/bindings/w1/omap-hdq.txt for more details).
54*4882a593SmuzhiyunBy default driver is in HDQ mode.
55