aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500
diff options
context:
space:
mode:
authorFabio Baltieri <fabio.baltieri@linaro.org>2013-05-24 06:39:15 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-05-25 15:58:21 -0400
commit6ee0b4b0ef871632b067f216b3032bf8db93c510 (patch)
tree43536e2343afaf33b1c8fa9adb445633d7b38358 /sound/soc/ux500
parentda33d723bcb3569400685b4e6e75a9894e2f42a7 (diff)
ASoC: ux500: Drop pinctrl sleep support
Drop pinctrl default/sleep state switching code, as it was breaking the capture interface by putting the I2S pins in hi-z mode regardless of its usage status, and not giving any real benefit. Pinctrl default mode configuration is already managed automatically by a specific pinctrl hog. Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/ux500')
-rw-r--r--sound/soc/ux500/ux500_msp_i2s.c56
-rw-r--r--sound/soc/ux500/ux500_msp_i2s.h6
2 files changed, 2 insertions, 60 deletions
diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c
index f2db6c90a9e2..b029b2d673d7 100644
--- a/sound/soc/ux500/ux500_msp_i2s.c
+++ b/sound/soc/ux500/ux500_msp_i2s.c
@@ -15,7 +15,6 @@
15 15
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/pinctrl/consumer.h>
19#include <linux/delay.h> 18#include <linux/delay.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include <linux/io.h> 20#include <linux/io.h>
@@ -26,9 +25,6 @@
26 25
27#include "ux500_msp_i2s.h" 26#include "ux500_msp_i2s.h"
28 27
29/* MSP1/3 Tx/Rx usage protection */
30static DEFINE_SPINLOCK(msp_rxtx_lock);
31
32 /* Protocol desciptors */ 28 /* Protocol desciptors */
33static const struct msp_protdesc prot_descs[] = { 29static const struct msp_protdesc prot_descs[] = {
34 { /* I2S */ 30 { /* I2S */
@@ -356,24 +352,8 @@ static int configure_multichannel(struct ux500_msp *msp,
356 352
357static int enable_msp(struct ux500_msp *msp, struct ux500_msp_config *config) 353static int enable_msp(struct ux500_msp *msp, struct ux500_msp_config *config)
358{ 354{
359 int status = 0, retval = 0; 355 int status = 0;
360 u32 reg_val_DMACR, reg_val_GCR; 356 u32 reg_val_DMACR, reg_val_GCR;
361 unsigned long flags;
362
363 /* Check msp state whether in RUN or CONFIGURED Mode */
364 if (msp->msp_state == MSP_STATE_IDLE) {
365 spin_lock_irqsave(&msp_rxtx_lock, flags);
366 if (msp->pinctrl_rxtx_ref == 0 &&
367 !(IS_ERR(msp->pinctrl_p) || IS_ERR(msp->pinctrl_def))) {
368 retval = pinctrl_select_state(msp->pinctrl_p,
369 msp->pinctrl_def);
370 if (retval)
371 pr_err("could not set MSP defstate\n");
372 }
373 if (!retval)
374 msp->pinctrl_rxtx_ref++;
375 spin_unlock_irqrestore(&msp_rxtx_lock, flags);
376 }
377 357
378 /* Configure msp with protocol dependent settings */ 358 /* Configure msp with protocol dependent settings */
379 configure_protocol(msp, config); 359 configure_protocol(msp, config);
@@ -630,8 +610,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction)
630 610
631int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir) 611int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir)
632{ 612{
633 int status = 0, retval = 0; 613 int status = 0;
634 unsigned long flags;
635 614
636 dev_dbg(msp->dev, "%s: Enter (dir = 0x%01x).\n", __func__, dir); 615 dev_dbg(msp->dev, "%s: Enter (dir = 0x%01x).\n", __func__, dir);
637 616
@@ -643,18 +622,6 @@ int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir)
643 (~(FRAME_GEN_ENABLE | SRG_ENABLE))), 622 (~(FRAME_GEN_ENABLE | SRG_ENABLE))),
644 msp->registers + MSP_GCR); 623 msp->registers + MSP_GCR);
645 624
646 spin_lock_irqsave(&msp_rxtx_lock, flags);
647 WARN_ON(!msp->pinctrl_rxtx_ref);
648 msp->pinctrl_rxtx_ref--;
649 if (msp->pinctrl_rxtx_ref == 0 &&
650 !(IS_ERR(msp->pinctrl_p) || IS_ERR(msp->pinctrl_sleep))) {
651 retval = pinctrl_select_state(msp->pinctrl_p,
652 msp->pinctrl_sleep);
653 if (retval)
654 pr_err("could not set MSP sleepstate\n");
655 }
656 spin_unlock_irqrestore(&msp_rxtx_lock, flags);
657
658 writel(0, msp->registers + MSP_GCR); 625 writel(0, msp->registers + MSP_GCR);
659 writel(0, msp->registers + MSP_TCF); 626 writel(0, msp->registers + MSP_TCF);
660 writel(0, msp->registers + MSP_RCF); 627 writel(0, msp->registers + MSP_RCF);
@@ -743,25 +710,6 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
743 dev_dbg(&pdev->dev, "I2S device-name: '%s'\n", i2s_cont->name); 710 dev_dbg(&pdev->dev, "I2S device-name: '%s'\n", i2s_cont->name);
744 msp->i2s_cont = i2s_cont; 711 msp->i2s_cont = i2s_cont;
745 712
746 msp->pinctrl_p = pinctrl_get(msp->dev);
747 if (IS_ERR(msp->pinctrl_p))
748 dev_err(&pdev->dev, "could not get MSP pinctrl\n");
749 else {
750 msp->pinctrl_def = pinctrl_lookup_state(msp->pinctrl_p,
751 PINCTRL_STATE_DEFAULT);
752 if (IS_ERR(msp->pinctrl_def)) {
753 dev_err(&pdev->dev,
754 "could not get MSP defstate (%li)\n",
755 PTR_ERR(msp->pinctrl_def));
756 }
757 msp->pinctrl_sleep = pinctrl_lookup_state(msp->pinctrl_p,
758 PINCTRL_STATE_SLEEP);
759 if (IS_ERR(msp->pinctrl_sleep))
760 dev_err(&pdev->dev,
761 "could not get MSP idlestate (%li)\n",
762 PTR_ERR(msp->pinctrl_def));
763 }
764
765 return 0; 713 return 0;
766} 714}
767 715
diff --git a/sound/soc/ux500/ux500_msp_i2s.h b/sound/soc/ux500/ux500_msp_i2s.h
index e5cd105c90f9..8ce014eb37e8 100644
--- a/sound/soc/ux500/ux500_msp_i2s.h
+++ b/sound/soc/ux500/ux500_msp_i2s.h
@@ -528,12 +528,6 @@ struct ux500_msp {
528 int loopback_enable; 528 int loopback_enable;
529 u32 backup_regs[MAX_MSP_BACKUP_REGS]; 529 u32 backup_regs[MAX_MSP_BACKUP_REGS];
530 unsigned int f_bitclk; 530 unsigned int f_bitclk;
531 /* Pin modes */
532 struct pinctrl *pinctrl_p;
533 struct pinctrl_state *pinctrl_def;
534 struct pinctrl_state *pinctrl_sleep;
535 /* Reference Count */
536 int pinctrl_rxtx_ref;
537}; 531};
538 532
539struct ux500_msp_dma_params { 533struct ux500_msp_dma_params {