diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-11-02 14:08:12 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-11-02 14:08:12 +0000 |
commit | 5fa21d8d3801ae92c901c70145c04d89e635776b (patch) | |
tree | fd7cc57b7f77d6c0a1b1edb43dedbc844f883780 /drivers/dahdi/xpp/init_card_1_30 | |
parent | 147994d6d13d9af2a2b3d0f524be4723d7a46282 (diff) |
xpp: Adaptations for E-Main-3
* An xbus transport now have a "model_string" member
* The xpp_usb driver fills this with "usb:<idVendor>/<idProduct>/<bcdDevice>"
* It is passed via environment to the "init_card_<type>_<protocol>" scripts
* The FXS script uses this to condition two registers according to
the power supply model.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10300 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp/init_card_1_30')
-rwxr-xr-x | drivers/dahdi/xpp/init_card_1_30 | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/dahdi/xpp/init_card_1_30 b/drivers/dahdi/xpp/init_card_1_30 index 6495f34..0813ead 100755 --- a/drivers/dahdi/xpp/init_card_1_30 +++ b/drivers/dahdi/xpp/init_card_1_30 @@ -51,6 +51,7 @@ BEGIN { $init_dir = dirname($0); unshift(@INC, "$init_dir"); } use XppConfig $init_dir; my $unit_id; my %opts; +my $vbat_48 = 0; getopts('o:', \%opts); @@ -78,6 +79,7 @@ if (-t STDERR) { foreach my $k (qw( XBUS_NAME XBUS_NUMBER + XBUS_MODEL_STRING UNIT_NUMBER UNIT_TYPE UNIT_SUBUNITS @@ -90,6 +92,10 @@ if (-t STDERR) { die; } } + logit "XBUS_MODEL_STRING='$ENV{XBUS_MODEL_STRING}'"; + if ($ENV{XBUS_MODEL_STRING} =~ m{.*/.*/201}) { + $vbat_48 = 1; + } $chipregs = sprintf "/sys/bus/xpds/devices/%02d:%1d:0/chipregs", $ENV{XBUS_NUMBER}, $ENV{UNIT_NUMBER}; if(! -f $chipregs) { @@ -286,11 +292,15 @@ sub init_indirect_registers() { } sub init_early_direct_regs() { + my $lbv = ($vbat_48) ? "20" : "10"; + my $vcm = ($vbat_48) ? "02" : "03"; + return write_to_slic_file("# * WD 08 00 # Audio Path Loopback Control * WD 6C 01 * WD 4A 3F # High Battery Voltage -* WD 4B 10 # Low Battery Voltage +* WD 4B $lbv # Low Battery Voltage +* WD 49 $vcm # Common Mode Voltage (VCM) * WD 40 00 # Line Feed Control #") } @@ -578,9 +588,6 @@ __DATA__ # On-Hook Line Voltage (VOC) * WD 48 20 -# Common Mode Voltage (VCM) -* WD 49 03 - * WS 1E 23 00 80 * WS 1E 24 20 03 * WS 1E 25 8C 00 |