Commit 6ee0b4b0ef871632b067f216b3032bf8db93c510

Authored by Fabio Baltieri
Committed by Mark Brown
1 parent da33d723bc

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>

Showing 2 changed files with 2 additions and 60 deletions Side-by-side Diff

sound/soc/ux500/ux500_msp_i2s.c
... ... @@ -15,7 +15,6 @@
15 15  
16 16 #include <linux/module.h>
17 17 #include <linux/platform_device.h>
18   -#include <linux/pinctrl/consumer.h>
19 18 #include <linux/delay.h>
20 19 #include <linux/slab.h>
21 20 #include <linux/io.h>
... ... @@ -26,9 +25,6 @@
26 25  
27 26 #include "ux500_msp_i2s.h"
28 27  
29   -/* MSP1/3 Tx/Rx usage protection */
30   -static DEFINE_SPINLOCK(msp_rxtx_lock);
31   -
32 28 /* Protocol desciptors */
33 29 static const struct msp_protdesc prot_descs[] = {
34 30 { /* I2S */
35 31  
36 32  
... ... @@ -356,25 +352,9 @@
356 352  
357 353 static 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 356 u32 reg_val_DMACR, reg_val_GCR;
361   - unsigned long flags;
362 357  
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   -
378 358 /* Configure msp with protocol dependent settings */
379 359 configure_protocol(msp, config);
380 360 setup_bitclk(msp, config);
... ... @@ -630,8 +610,7 @@
630 610  
631 611 int ux500_msp_i2s_close(struct ux500_msp *msp, unsigned int dir)
632 612 {
633   - int status = 0, retval = 0;
634   - unsigned long flags;
  613 + int status = 0;
635 614  
636 615 dev_dbg(msp->dev, "%s: Enter (dir = 0x%01x).\n", __func__, dir);
637 616  
... ... @@ -643,18 +622,6 @@
643 622 (~(FRAME_GEN_ENABLE | SRG_ENABLE))),
644 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 625 writel(0, msp->registers + MSP_GCR);
659 626 writel(0, msp->registers + MSP_TCF);
660 627 writel(0, msp->registers + MSP_RCF);
... ... @@ -742,25 +709,6 @@
742 709 msp->id);
743 710 dev_dbg(&pdev->dev, "I2S device-name: '%s'\n", i2s_cont->name);
744 711 msp->i2s_cont = i2s_cont;
745   -
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 712  
765 713 return 0;
766 714 }
sound/soc/ux500/ux500_msp_i2s.h
... ... @@ -528,12 +528,6 @@
528 528 int loopback_enable;
529 529 u32 backup_regs[MAX_MSP_BACKUP_REGS];
530 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  
539 533 struct ux500_msp_dma_params {