blob: 0ce07ea37cb513c790a4783f6e1219fedfab0358 [file] [log] [blame]
Sergey Solomin11d63cf2016-11-28 15:03:24 -06001#!/bin/sh
2# #############################################################
3# script to disable UCD VCS rails.
4# This REQUIRES unaltered/original UCD cfg file.
5# 10/28/16 PGR -
6# 11/10/16 PGR - unbind/bind UCD driver
7
8# unbind ucd driver to permit i2cset
9ucdpath="/sys/bus/i2c/drivers/ucd9000"
10if [ -e $ucdpath ]
11then
12 ucd=`ls $ucdpath | grep 64`
13 echo $ucd > $ucdpath/unbind
14fi
15
16# Setup UCD module (in standby) to disable VCS rails from power-on:
17i2cset -y 11 0x64 0xF7 0x00 i
18i2cset -y 11 0x64 0xF8 0x15 0x6E 0x80 0x0A 0x00 0x00 0x10 0x00 0x00 0x00 \
19 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 i
20i2cset -y 11 0x64 0xF7 0x01 i
21i2cset -y 11 0x64 0xF8 0x15 0x16 0x80 0x14 0x00 0x00 0x20 0x00 0x00 0x00 \
22 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 i
23i2cset -y 11 0x64 0xD2 0x09 0x3F 0xFF 0x2F 0x0A 0x00 0x06 0x00 0x00 0x02 i
24i2cset -y 11 0x64 0x00 0x0E i
25i2cset -y 11 0x64 0x02 0x1A i
26i2cset -y 11 0x64 0x00 0x0F i
27i2cset -y 11 0x64 0x02 0x1A i
28
29# re-bind ucd driver
Saqib Khane71ba0b2017-02-08 10:13:01 -060030ucd_retries="5"
31if [ -e $ucdpath ]; then
32 i=0
33 until [ $i -ge $ucd_retries ] || [ -e $ucdpath/$ucd ]; do
34 i=$((i+1))
35 echo $ucd > $ucdpath/bind || ret=$?
36 done
37 if [ ! -e $ucdpath/$ucd ]; then exit $ret; fi
Sergey Solomin11d63cf2016-11-28 15:03:24 -060038fi
Saqib Khane71ba0b2017-02-08 10:13:01 -060039