ret = of_property_read_u32(np, "mux-int-port", &int_port); if (ret) {
dev_err(&pdev->dev, "mux-int-port missing or invalid\n"); return ret;
}
ret = of_property_read_u32(np, "mux-ext-port", &ext_port); if (ret) {
dev_err(&pdev->dev, "mux-ext-port missing or invalid\n"); return ret;
}
/* * The port numbering in the hardware manual starts at 1, while * the audmux API expects it starts at 0.
*/
int_port--;
ext_port--;
ret = imx_audmux_v2_configure_port(int_port,
IMX_AUDMUX_V2_PTCR_SYN |
IMX_AUDMUX_V2_PTCR_TFSEL(ext_port) |
IMX_AUDMUX_V2_PTCR_TCSEL(ext_port) |
IMX_AUDMUX_V2_PTCR_TFSDIR |
IMX_AUDMUX_V2_PTCR_TCLKDIR,
IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port)); if (ret) {
dev_err(&pdev->dev, "audmux internal port setup failed\n"); return ret;
}
ret = imx_audmux_v2_configure_port(ext_port,
IMX_AUDMUX_V2_PTCR_SYN,
IMX_AUDMUX_V2_PDCR_RXDSEL(int_port)); if (ret) {
dev_err(&pdev->dev, "audmux external port setup failed\n"); return ret;
}
ssi_np = of_parse_phandle(pdev->dev.of_node, "ssi-controller", 0);
codec_np = of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); if (!ssi_np || !codec_np) {
dev_err(&pdev->dev, "phandle missing or invalid\n");
ret = -EINVAL; goto fail;
}
ssi_pdev = of_find_device_by_node(ssi_np); if (!ssi_pdev) {
dev_dbg(&pdev->dev, "failed to find SSI platform device\n");
ret = -EPROBE_DEFER; goto fail;
}
put_device(&ssi_pdev->dev);
codec_dev = of_find_i2c_device_by_node(codec_np); if (!codec_dev) {
dev_dbg(&pdev->dev, "failed to find codec platform device\n");
ret = -EPROBE_DEFER; goto fail;
}
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) {
ret = -ENOMEM; goto put_device;
}
comp = devm_kzalloc(&pdev->dev, 3 * sizeof(*comp), GFP_KERNEL); if (!comp) {
ret = -ENOMEM; goto put_device;
}
data->codec_clk = clk_get(&codec_dev->dev, NULL); if (IS_ERR(data->codec_clk)) {
ret = PTR_ERR(data->codec_clk); goto put_device;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.