Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

allwinner: a523: Enable I2S and SPDIF TX

Merge series from Chen-Yu Tsai <wens@kernel.org>:

This series enables the SPDIF and I2S hardware found on the Allwinner
A523/A527/T527 family SoCs. These SoCs have one SPDIF interface and
four I2S interfaces. All of them are capable of both playback and
capture, however the SPDIF driver only supports playback.

+65 -9
+3 -1
Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml
··· 33 33 - const: allwinner,sun50i-h6-i2s 34 34 - const: allwinner,sun50i-r329-i2s 35 35 - items: 36 - - const: allwinner,sun20i-d1-i2s 36 + - enum: 37 + - allwinner,sun20i-d1-i2s 38 + - allwinner,sun55i-a523-i2s 37 39 - const: allwinner,sun50i-r329-i2s 38 40 39 41 reg:
+38 -6
Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
··· 23 23 - const: allwinner,sun8i-h3-spdif 24 24 - const: allwinner,sun50i-h6-spdif 25 25 - const: allwinner,sun50i-h616-spdif 26 + - const: allwinner,sun55i-a523-spdif 26 27 - items: 27 28 - const: allwinner,sun8i-a83t-spdif 28 29 - const: allwinner,sun8i-h3-spdif ··· 38 37 maxItems: 1 39 38 40 39 clocks: 41 - items: 42 - - description: Bus Clock 43 - - description: Module Clock 40 + minItems: 2 41 + maxItems: 3 44 42 45 43 clock-names: 46 - items: 47 - - const: apb 48 - - const: spdif 44 + minItems: 2 45 + maxItems: 3 49 46 50 47 # Even though it only applies to subschemas under the conditionals, 51 48 # not listing them here will trigger a warning because of the ··· 64 65 - allwinner,sun8i-h3-spdif 65 66 - allwinner,sun50i-h6-spdif 66 67 - allwinner,sun50i-h616-spdif 68 + - allwinner,sun55i-a523-spdif 67 69 68 70 then: 69 71 required: ··· 97 97 items: 98 98 - const: rx 99 99 - const: tx 100 + 101 + - if: 102 + properties: 103 + compatible: 104 + contains: 105 + enum: 106 + - allwinner,sun55i-a523-spdif 107 + 108 + then: 109 + properties: 110 + clocks: 111 + items: 112 + - description: Bus Clock 113 + - description: TX Clock 114 + - description: RX Clock 115 + 116 + clock-names: 117 + items: 118 + - const: apb 119 + - const: tx 120 + - const: rx 121 + else: 122 + properties: 123 + clocks: 124 + items: 125 + - description: Bus Clock 126 + - description: Module Clock 127 + 128 + clock-names: 129 + items: 130 + - const: apb 131 + - const: spdif 100 132 101 133 required: 102 134 - "#sound-dai-cells"
+24 -2
sound/soc/sunxi/sun4i-spdif.c
··· 177 177 bool has_reset; 178 178 unsigned int val_fctl_ftx; 179 179 unsigned int mclk_multiplier; 180 + const char *tx_clk_name; 180 181 }; 181 182 182 183 struct sun4i_spdif_dev { ··· 573 572 .mclk_multiplier = 1, 574 573 }; 575 574 575 + static const struct sun4i_spdif_quirks sun55i_a523_spdif_quirks = { 576 + .reg_dac_txdata = SUN8I_SPDIF_TXFIFO, 577 + .val_fctl_ftx = SUN50I_H6_SPDIF_FCTL_FTX, 578 + .has_reset = true, 579 + .mclk_multiplier = 1, 580 + .tx_clk_name = "tx", 581 + }; 582 + 576 583 static const struct of_device_id sun4i_spdif_of_match[] = { 577 584 { 578 585 .compatible = "allwinner,sun4i-a10-spdif", ··· 602 593 .compatible = "allwinner,sun50i-h616-spdif", 603 594 /* Essentially the same as the H6, but without RX */ 604 595 .data = &sun50i_h6_spdif_quirks, 596 + }, 597 + { 598 + .compatible = "allwinner,sun55i-a523-spdif", 599 + /* 600 + * Almost the same as H6, but has split the TX and RX clocks, 601 + * has a separate reset bit for the RX side, and has some 602 + * expanded features for the RX side. 603 + */ 604 + .data = &sun55i_a523_spdif_quirks, 605 605 }, 606 606 { /* sentinel */ } 607 607 }; ··· 653 635 const struct sun4i_spdif_quirks *quirks; 654 636 int ret; 655 637 void __iomem *base; 638 + const char *tx_clk_name = "spdif"; 656 639 657 640 dev_dbg(&pdev->dev, "Entered %s\n", __func__); 658 641 ··· 690 671 return PTR_ERR(host->apb_clk); 691 672 } 692 673 693 - host->spdif_clk = devm_clk_get(&pdev->dev, "spdif"); 674 + if (quirks->tx_clk_name) 675 + tx_clk_name = quirks->tx_clk_name; 676 + host->spdif_clk = devm_clk_get(&pdev->dev, tx_clk_name); 694 677 if (IS_ERR(host->spdif_clk)) { 695 - dev_err(&pdev->dev, "failed to get a spdif clock.\n"); 678 + dev_err(&pdev->dev, "failed to get the \"%s\" clock.\n", 679 + tx_clk_name); 696 680 return PTR_ERR(host->spdif_clk); 697 681 } 698 682