[svn-commits] tzafrir: branch linux/2.6 r10489 - /linux/branches/2.6/drivers/dahdi/xpp/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Mar 15 12:36:01 CDT 2012
Author: tzafrir
Date: Thu Mar 15 12:35:57 2012
New Revision: 10489
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10489
Log:
xpp: reset Astribank SPI busses
* A driver reload should reset Astribank hardware
* This patch send an SPI reset after we get AB_DESCRIPTION reply from Astribank
Signed-off-by: Oron Peled <oron.peled at xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10474
Modified:
linux/branches/2.6/drivers/dahdi/xpp/card_global.c
linux/branches/2.6/drivers/dahdi/xpp/card_global.h
Modified: linux/branches/2.6/drivers/dahdi/xpp/card_global.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.6/drivers/dahdi/xpp/card_global.c?view=diff&rev=10489&r1=10488&r2=10489
==============================================================================
--- linux/branches/2.6/drivers/dahdi/xpp/card_global.c (original)
+++ linux/branches/2.6/drivers/dahdi/xpp/card_global.c Thu Mar 15 12:35:57 2012
@@ -422,17 +422,35 @@
return 0;
}
-/* 0x23 */ HOSTCMD(GLOBAL, RESET_SYNC_COUNTERS)
+/*
+ * Wrapper for different types of xbus reset
+ */
+static int send_xbus_reset(xbus_t *xbus, uint8_t reset_mask)
{
xframe_t *xframe;
xpacket_t *pack;
BUG_ON(!xbus);
- //XBUS_DBG(SYNC, xbus, "\n");
- XFRAME_NEW_CMD(xframe, pack, xbus, GLOBAL, RESET_SYNC_COUNTERS, 0);
- RPACKET_FIELD(pack, GLOBAL, RESET_SYNC_COUNTERS, mask) = 0x10;
+ XFRAME_NEW_CMD(xframe, pack, xbus, GLOBAL, XBUS_RESET, 0);
+ RPACKET_FIELD(pack, GLOBAL, XBUS_RESET, mask) = reset_mask;
send_cmd_frame(xbus, xframe);
return 0;
+}
+
+/* 0x23 */ HOSTCMD(GLOBAL, RESET_SPI)
+{
+ XBUS_DBG(DEVICES, xbus, "Sending SPI reset\n");
+ /* toggle reset line */
+ send_xbus_reset(xbus, 0x04);
+ send_xbus_reset(xbus, 0x00);
+ return 0;
+}
+
+
+/* 0x23 */ HOSTCMD(GLOBAL, RESET_SYNC_COUNTERS)
+{
+ //XBUS_DBG(SYNC, xbus, "\n");
+ return send_xbus_reset(xbus, 0x10);
}
/*---------------- GLOBAL: Astribank Reply Handlers -----------------------*/
@@ -526,6 +544,7 @@
list_add_tail(&card_desc->card_list, &worker->card_list);
spin_unlock_irqrestore(&worker->worker_lock, flags);
}
+ CALL_PROTO(GLOBAL, RESET_SPI, xbus, NULL);
if (!xbus_process_worker(xbus)) {
ret = -ENODEV;
goto out;
Modified: linux/branches/2.6/drivers/dahdi/xpp/card_global.h
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.6/drivers/dahdi/xpp/card_global.h?view=diff&rev=10489&r1=10488&r2=10489
==============================================================================
--- linux/branches/2.6/drivers/dahdi/xpp/card_global.h (original)
+++ linux/branches/2.6/drivers/dahdi/xpp/card_global.h Thu Mar 15 12:35:57 2012
@@ -38,7 +38,7 @@
XPROTO_NAME(GLOBAL, SYNC_REPLY) = 0x1A,
/**/
XPROTO_NAME(GLOBAL, ERROR_CODE) = 0x22,
- XPROTO_NAME(GLOBAL, RESET_SYNC_COUNTERS) = 0x23,
+ XPROTO_NAME(GLOBAL, XBUS_RESET) = 0x23,
XPROTO_NAME(GLOBAL, NULL_REPLY) = 0xFE,
};
@@ -87,7 +87,7 @@
DEF_RPACKET_DATA(GLOBAL, REGISTER_REPLY,
reg_cmd_t regcmd;
);
-DEF_RPACKET_DATA(GLOBAL, RESET_SYNC_COUNTERS,
+DEF_RPACKET_DATA(GLOBAL, XBUS_RESET,
byte mask;
);
DEF_RPACKET_DATA(GLOBAL, ERROR_CODE,
@@ -98,6 +98,7 @@
/* 0x07 */ DECLARE_CMD(GLOBAL, AB_REQUEST);
/* 0x19 */ DECLARE_CMD(GLOBAL, SYNC_SOURCE, enum sync_mode mode, int drift);
+/* 0x23 */ DECLARE_CMD(GLOBAL, RESET_SPI);
/* 0x23 */ DECLARE_CMD(GLOBAL, RESET_SYNC_COUNTERS);
int xpp_register_request(xbus_t *xbus, xpd_t *xpd, xportno_t portno,
More information about the svn-commits
mailing list