1e9bb6275SMauro Carvalho Chehab======================================== 2e9bb6275SMauro Carvalho ChehabKernel driver for omap HDQ/1-wire module 3e9bb6275SMauro Carvalho Chehab======================================== 4e9bb6275SMauro Carvalho Chehab 5e9bb6275SMauro Carvalho ChehabSupported chips: 6e9bb6275SMauro Carvalho Chehab================ 7e9bb6275SMauro Carvalho ChehabHDQ/1-wire controller on the TI OMAP 2430/3430 platforms. 8e9bb6275SMauro Carvalho Chehab 9e9bb6275SMauro Carvalho ChehabA useful link about HDQ basics: 10e9bb6275SMauro Carvalho Chehab=============================== 11e9bb6275SMauro Carvalho Chehabhttp://focus.ti.com/lit/an/slua408a/slua408a.pdf 12e9bb6275SMauro Carvalho Chehab 13e9bb6275SMauro Carvalho ChehabDescription: 14e9bb6275SMauro Carvalho Chehab============ 15e9bb6275SMauro Carvalho ChehabThe HDQ/1-Wire module of TI OMAP2430/3430 platforms implement the hardware 16e9bb6275SMauro Carvalho Chehabprotocol of the master functions of the Benchmark HDQ and the Dallas 17e9bb6275SMauro Carvalho ChehabSemiconductor 1-Wire protocols. These protocols use a single wire for 18e9bb6275SMauro Carvalho Chehabcommunication between the master (HDQ/1-Wire controller) and the slave 19e9bb6275SMauro Carvalho Chehab(HDQ/1-Wire external compliant device). 20e9bb6275SMauro Carvalho Chehab 21e9bb6275SMauro Carvalho ChehabA typical application of the HDQ/1-Wire module is the communication with battery 22e9bb6275SMauro Carvalho Chehabmonitor (gas gauge) integrated circuits. 23e9bb6275SMauro Carvalho Chehab 24e9bb6275SMauro Carvalho ChehabThe controller supports operation in both HDQ and 1-wire mode. The essential 25e9bb6275SMauro Carvalho Chehabdifference between the HDQ and 1-wire mode is how the slave device responds to 26e9bb6275SMauro Carvalho Chehabinitialization pulse.In HDQ mode, the firmware does not require the host to 27e9bb6275SMauro Carvalho Chehabcreate an initialization pulse to the slave.However, the slave can be reset by 28e9bb6275SMauro Carvalho Chehabusing an initialization pulse (also referred to as a break pulse).The slave 29e9bb6275SMauro Carvalho Chehabdoes not respond with a presence pulse as it does in the 1-Wire protocol. 30e9bb6275SMauro Carvalho Chehab 31e9bb6275SMauro Carvalho ChehabRemarks: 32e9bb6275SMauro Carvalho Chehab======== 33e9bb6275SMauro Carvalho ChehabThe driver (drivers/w1/masters/omap_hdq.c) supports the HDQ mode of the 34e9bb6275SMauro Carvalho Chehabcontroller. In this mode, as we can not read the ID which obeys the W1 35e9bb6275SMauro Carvalho Chehabspec(family:id:crc), a module parameter can be passed to the driver which will 36e9bb6275SMauro Carvalho Chehabbe used to calculate the CRC and pass back an appropriate slave ID to the W1 37e9bb6275SMauro Carvalho Chehabcore. 38e9bb6275SMauro Carvalho Chehab 39e9bb6275SMauro Carvalho ChehabBy default the master driver and the BQ slave i/f 40e9bb6275SMauro Carvalho Chehabdriver(drivers/w1/slaves/w1_bq27000.c) sets the ID to 1. 41e9bb6275SMauro Carvalho ChehabPlease note to load both the modules with a different ID if required, but note 42e9bb6275SMauro Carvalho Chehabthat the ID used should be same for both master and slave driver loading. 43e9bb6275SMauro Carvalho Chehab 44e9bb6275SMauro Carvalho Chehabe.g:: 45e9bb6275SMauro Carvalho Chehab 46e9bb6275SMauro Carvalho Chehab insmod omap_hdq.ko W1_ID=2 476c23821cSMasanari Iida insmod w1_bq27000.ko F_ID=2 48e9bb6275SMauro Carvalho Chehab 49e9bb6275SMauro Carvalho ChehabThe driver also supports 1-wire mode. In this mode, there is no need to 50e9bb6275SMauro Carvalho Chehabpass slave ID as parameter. The driver will auto-detect slaves connected 51e9bb6275SMauro Carvalho Chehabto the bus using SEARCH_ROM procedure. 1-wire mode can be selected by 52e9bb6275SMauro Carvalho Chehabsetting "ti,mode" property to "1w" in DT (see 53e9bb6275SMauro Carvalho ChehabDocumentation/devicetree/bindings/w1/omap-hdq.txt for more details). 54e9bb6275SMauro Carvalho ChehabBy default driver is in HDQ mode. 55