kirkwood-i2s.c (112d6212c80a1c560757520bd822a41c0ad15c2c) kirkwood-i2s.c (4523817d51bc3b2ef38da768d004fda2c8bc41de)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * kirkwood-i2s.c
4 *
5 * (c) 2010 Arnaud Patard <apatard@mandriva.com>
6 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
7 */
8

--- 541 unchanged lines hidden (view full) ---

550 }
551
552 priv->clk = devm_clk_get(&pdev->dev, np ? "internal" : NULL);
553 if (IS_ERR(priv->clk)) {
554 dev_err(&pdev->dev, "no clock\n");
555 return PTR_ERR(priv->clk);
556 }
557
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * kirkwood-i2s.c
4 *
5 * (c) 2010 Arnaud Patard <apatard@mandriva.com>
6 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
7 */
8

--- 541 unchanged lines hidden (view full) ---

550 }
551
552 priv->clk = devm_clk_get(&pdev->dev, np ? "internal" : NULL);
553 if (IS_ERR(priv->clk)) {
554 dev_err(&pdev->dev, "no clock\n");
555 return PTR_ERR(priv->clk);
556 }
557
558 err = clk_prepare_enable(priv->clk);
559 if (err < 0)
560 return err;
561
562 priv->extclk = devm_clk_get(&pdev->dev, "extclk");
563 if (IS_ERR(priv->extclk)) {
564 if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
565 return -EPROBE_DEFER;
566 } else {
567 if (clk_is_match(priv->extclk, priv->clk)) {
568 devm_clk_put(&pdev->dev, priv->extclk);
569 priv->extclk = ERR_PTR(-EINVAL);
570 } else {
571 dev_info(&pdev->dev, "found external clock\n");
572 clk_prepare_enable(priv->extclk);
573 soc_dai = kirkwood_i2s_dai_extclk;
574 }
575 }
576
558 priv->extclk = devm_clk_get(&pdev->dev, "extclk");
559 if (IS_ERR(priv->extclk)) {
560 if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
561 return -EPROBE_DEFER;
562 } else {
563 if (clk_is_match(priv->extclk, priv->clk)) {
564 devm_clk_put(&pdev->dev, priv->extclk);
565 priv->extclk = ERR_PTR(-EINVAL);
566 } else {
567 dev_info(&pdev->dev, "found external clock\n");
568 clk_prepare_enable(priv->extclk);
569 soc_dai = kirkwood_i2s_dai_extclk;
570 }
571 }
572
573 err = clk_prepare_enable(priv->clk);
574 if (err < 0)
575 return err;
576
577 /* Some sensible defaults - this reflects the powerup values */
578 priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24;
579 priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24;
580
581 /* Select the burst size */
582 if (priv->burst == 32) {
583 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_32;
584 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32;

--- 61 unchanged lines hidden ---
577 /* Some sensible defaults - this reflects the powerup values */
578 priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24;
579 priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24;
580
581 /* Select the burst size */
582 if (priv->burst == 32) {
583 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_32;
584 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32;

--- 61 unchanged lines hidden ---