/* * imx-mc13783.c -- SoC audio for imx based boards with mc13783 codec * * Copyright 2012 Philippe Retornaz, * * Heavly based on phycore-mc13783: * Copyright 2009 Sascha Hauer, Pengutronix * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * */ #include #include #include #include #include #include #include #include #include "../codecs/mc13783.h" #include "imx-ssi.h" #include "imx-audmux.h" #define FMT_SSI (SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | \ SND_SOC_DAIFMT_CBM_CFM) static int imx_mc13783_hifi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai; int ret; ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 4, 16); if (ret) return ret; ret = snd_soc_dai_set_sysclk(codec_dai, MC13783_CLK_CLIA, 26000000, 0); if (ret) return ret; return snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 16); } static struct snd_soc_ops imx_mc13783_hifi_ops = { .hw_params = imx_mc13783_hifi_hw_params, }; static struct snd_soc_dai_link imx_mc13783_dai_mc13783[] = { { .name = "MC13783", .stream_name = "Sound", .codec_dai_name = "mc13783-hifi", .codec_name = "mc13783-codec", .cpu_dai_name = "imx-ssi.0", .platform_name = "imx-ssi.0", .ops = &imx_mc13783_hifi_ops, .symmetric_rates = 1, .dai_fmt = FMT_SSI, }, }; static const struct snd_soc_dapm_widget imx_mc13783_widget[] = { SND_SOC_DAPM_MIC("Mic", NULL), SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_SPK("Speaker", NULL), }; static const struct snd_soc_dapm_route imx_mc13783_routes[] = { {"Speaker", NULL, "LSP"}, {"Headphone", NULL, "HSL"}, {"Headphone", NULL, "HSR"}, {"MC1LIN", NULL, "MC1 Bias"}, {"MC2IN", NULL, "MC2 Bias"}, {"MC1 Bias", NULL, "Mic"}, {"MC2 Bias", NULL, "Mic"}, }; static struct snd_soc_card imx_mc13783 = { .name = "imx_mc13783", .owner = THIS_MODULE, .dai_link = imx_mc13783_dai_mc13783, .num_links = ARRAY_SIZE(imx_mc13783_dai_mc13783), .dapm_widgets = imx_mc13783_widget, .num_dapm_widgets = ARRAY_SIZE(imx_mc13783_widget), .dapm_routes = imx_mc13783_routes, .num_dapm_routes = ARRAY_SIZE(imx_mc13783_routes), }; static int imx_mc13783_probe(struct platform_device *pdev) { int ret; imx_mc13783.dev = &pdev->dev; ret = snd_soc_register_card(&imx_mc13783); if (ret) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); return ret; } if (machine_is_mx31_3ds() || machine_is_mx31moboard()) { imx_audmux_v2_configure_port(MX31_AUDMUX_PORT4_SSI_PINS_4, IMX_AUDMUX_V2_PTCR_SYN, IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT1_SSI0) | IMX_AUDMUX_V2_PDCR_MODE(1) | IMX_AUDMUX_V2_PDCR_INMMASK(0xfc)); imx_audmux_v2_configure_port(MX31_AUDMUX_PORT1_SSI0, IMX_AUDMUX_V2_PTCR_SYN | IMX_AUDMUX_V2_PTCR_TFSDIR | IMX_AUDMUX_V2_PTCR_TFSEL(MX31_AUDMUX_PORT4_SSI_PINS_4) | IMX_AUDMUX_V2_PTCR_TCLKDIR | IMX_AUDMUX_V2_PTCR_TCSEL(MX31_AUDMUX_PORT4_SSI_PINS_4) | IMX_AUDMUX_V2_PTCR_RFSDIR | IMX_AUDMUX_V2_PTCR_RFSEL(MX31_AUDMUX_PORT4_SSI_PINS_4) | IMX_AUDMUX_V2_PTCR_RCLKDIR | IMX_AUDMUX_V2_PTCR_RCSEL(MX31_AUDMUX_PORT4_SSI_PINS_4), IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT4_SSI_PINS_4)); } else if (machine_is_mx27_3ds()) { imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0, IMX_AUDMUX_V1_PCR_SYN | IMX_AUDMUX_V1_PCR_TFSDIR | IMX_AUDMUX_V1_PCR_TCLKDIR | IMX_AUDMUX_V1_PCR_RFSDIR | IMX_AUDMUX_V1_PCR_RCLKDIR | IMX_AUDMUX_V1_PCR_TFCSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) | IMX_AUDMUX_V1_PCR_RFCSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) | IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR3_SSI_PINS_4) ); imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR3_SSI_PINS_4, IMX_AUDMUX_V1_PCR_SYN | IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0) ); } return ret; } static int imx_mc13783_remove(struct platform_device *pdev) { snd_soc_unregister_card(&imx_mc13783); return 0; } static struct platform_driver imx_mc13783_audio_driver = { .driver = { .name = "imx_mc13783", }, .probe = imx_mc13783_probe, .remove = imx_mc13783_remove }; module_platform_driver(imx_mc13783_audio_driver); MODULE_AUTHOR("Sascha Hauer "); MODULE_AUTHOR("Philippe Retornaz patch) tree1ec6c08cd75610083d117a2c8d5eb0829e65f33e /net/rxrpc parent69978aa0f21f43529e11f924504dadb6ce2f229a (diff)parentb4cfe3971f6eab542dd7ecc398bfa1aeec889934 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull rdma fixes from Doug Ledford: "Second round of -rc fixes for 4.10. This -rc cycle has been slow for the rdma subsystem. I had already sent you the first batch before the Holiday break. After that, we kept only getting a few here or there. Up until this week, when I got a drop of 13 to one driver (qedr). So, here's the -rc patches I have. I currently have none held in reserve, so unless something new comes in, this is it until the next merge window opens. Summary: - series of iw_cxgb4 fixes to make it work with the drain cq API - one or two patches each to: srp, iser, cxgb3, vmw_pvrdma, umem, rxe, and ipoib - one big series (13 patches) for the new qedr driver" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (27 commits) RDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled IB/rxe: Prevent from completer to operate on non valid QP IB/rxe: Fix rxe dev insertion to rxe_dev_list IB/umem: Release pid in error and ODP flow RDMA/qedr: Dispatch port active event from qedr_add RDMA/qedr: Fix and simplify memory leak in PD alloc RDMA/qedr: Fix RDMA CM loopback RDMA/qedr: Fix formatting RDMA/qedr: Mark three functions as static RDMA/qedr: Don't reset QP when queues aren't flushed RDMA/qedr: Don't spam dmesg if QP is in error state RDMA/qedr: Remove CQ spinlock from CM completion handlers RDMA/qedr: Return max inline data in QP query result RDMA/qedr: Return success when not changing QP state RDMA/qedr: Add uapi header qedr-abi.h RDMA/qedr: Fix MTU returned from QP query RDMA/core: Add the function ib_mtu_int_to_enum IB/vmw_pvrdma: Fix incorrect cleanup on pvrdma_pci_probe error path IB/vmw_pvrdma: Don't leak info from alloc_ucontext IB/cxgb3: fix misspelling in header guard ...
Diffstat (limited to 'net/rxrpc')