]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/xilinx_hwicap/fifo_icap.c
xilinx_hwicap: remove improper wording in license statement
[linux-2.6-omap-h63xx.git] / drivers / char / xilinx_hwicap / fifo_icap.c
index 6f45dbd47125636a44af08d8b2dab33a70e3bf4c..02225eb19cf6bd2e6d99085b6edea7aa4801c30b 100644 (file)
@@ -21,9 +21,6 @@
  *     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  *     FOR A PARTICULAR PURPOSE.
  *
- *     Xilinx products are not intended for use in life support appliances,
- *     devices, or systems. Use in such applications is expressly prohibited.
- *
  *     (c) Copyright 2007-2008 Xilinx Inc.
  *     All rights reserved.
  *
 #define XHI_CR_READ_MASK 0x00000002 /* Read from ICAP to FIFO */
 #define XHI_CR_WRITE_MASK 0x00000001 /* Write from FIFO to ICAP */
 
-/* Status Register (SR) */
-#define XHI_SR_CFGERR_N_MASK 0x00000100 /* Config Error Mask */
-#define XHI_SR_DALIGN_MASK 0x00000080 /* Data Alignment Mask */
-#define XHI_SR_RIP_MASK 0x00000040 /* Read back Mask */
-#define XHI_SR_IN_ABORT_N_MASK 0x00000020 /* Select Map Abort Mask */
-#define XHI_SR_DONE_MASK 0x00000001 /* Done bit Mask  */
-
 
 #define XHI_WFO_MAX_VACANCY 1024 /* Max Write FIFO Vacancy, in words */
 #define XHI_RFO_MAX_OCCUPANCY 256 /* Max Read FIFO Occupancy, in words */
@@ -151,6 +141,29 @@ static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata)
        dev_dbg(drvdata->dev, "readback started\n");
 }
 
+/**
+ * fifo_icap_get_status - Get the contents of the status register.
+ * @drvdata: a pointer to the drvdata.
+ *
+ * The status register contains the ICAP status and the done bit.
+ *
+ * D8 - cfgerr
+ * D7 - dalign
+ * D6 - rip
+ * D5 - in_abort_l
+ * D4 - Always 1
+ * D3 - Always 1
+ * D2 - Always 1
+ * D1 - Always 1
+ * D0 - Done bit
+ **/
+u32 fifo_icap_get_status(struct hwicap_drvdata *drvdata)
+{
+       u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET);
+       dev_dbg(drvdata->dev, "Getting status = %x\n", status);
+       return status;
+}
+
 /**
  * fifo_icap_busy - Return true if the ICAP is still processing a transaction.
  * @drvdata: a pointer to the drvdata.
@@ -158,7 +171,6 @@ static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata)
 static inline u32 fifo_icap_busy(struct hwicap_drvdata *drvdata)
 {
        u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET);
-       dev_dbg(drvdata->dev, "Getting status = %x\n", status);
        return (status & XHI_SR_DONE_MASK) ? 0 : 1;
 }