|
@@ -198,6 +198,56 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
|
|
|
}
|
|
|
EXPORT_SYMBOL(omap_mcbsp_config);
|
|
|
|
|
|
+#ifdef CONFIG_ARCH_OMAP34XX
|
|
|
+/*
|
|
|
+ * omap_mcbsp_set_tx_threshold configures how to deal
|
|
|
+ * with transmit threshold. the threshold value and handler can be
|
|
|
+ * configure in here.
|
|
|
+ */
|
|
|
+void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold)
|
|
|
+{
|
|
|
+ struct omap_mcbsp *mcbsp;
|
|
|
+ void __iomem *io_base;
|
|
|
+
|
|
|
+ if (!cpu_is_omap34xx())
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (!omap_mcbsp_check_valid_id(id)) {
|
|
|
+ printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mcbsp = id_to_mcbsp_ptr(id);
|
|
|
+ io_base = mcbsp->io_base;
|
|
|
+
|
|
|
+ OMAP_MCBSP_WRITE(io_base, THRSH2, threshold);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(omap_mcbsp_set_tx_threshold);
|
|
|
+
|
|
|
+/*
|
|
|
+ * omap_mcbsp_set_rx_threshold configures how to deal
|
|
|
+ * with receive threshold. the threshold value and handler can be
|
|
|
+ * configure in here.
|
|
|
+ */
|
|
|
+void omap_mcbsp_set_rx_threshold(unsigned int id, u16 threshold)
|
|
|
+{
|
|
|
+ struct omap_mcbsp *mcbsp;
|
|
|
+ void __iomem *io_base;
|
|
|
+
|
|
|
+ if (!cpu_is_omap34xx())
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (!omap_mcbsp_check_valid_id(id)) {
|
|
|
+ printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mcbsp = id_to_mcbsp_ptr(id);
|
|
|
+ io_base = mcbsp->io_base;
|
|
|
+
|
|
|
+ OMAP_MCBSP_WRITE(io_base, THRSH1, threshold);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(omap_mcbsp_set_rx_threshold);
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
* We can choose between IRQ based or polled IO.
|
|
|
* This needs to be called before omap_mcbsp_request().
|