Lines Matching +full:sun8i +full:- +full:a33 +full:- +full:codec
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
133 { "allwinner,sun8i-a33-codec", 1},
140 { -1, 0 }
152 #define CODEC_LOCK(sc) mtx_lock(&(sc)->mtx)
153 #define CODEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx)
154 #define CODEC_READ(sc, reg) bus_read_4((sc)->res[0], (reg))
155 #define CODEC_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val))
167 if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) in sun8i_codec_probe()
170 device_set_desc(dev, "Allwinner Codec"); in sun8i_codec_probe()
184 sc->dev = dev; in sun8i_codec_attach()
187 mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); in sun8i_codec_attach()
189 if (bus_alloc_resources(dev, sun8i_codec_spec, sc->res) != 0) { in sun8i_codec_attach()
195 error = clk_get_by_ofw_name(dev, 0, "mod", &sc->clk_mod); in sun8i_codec_attach()
201 error = clk_get_by_ofw_name(dev, 0, "bus", &sc->clk_gate); in sun8i_codec_attach()
207 error = clk_enable(sc->clk_gate); in sun8i_codec_attach()
234 /* Set AIF1 to 16-bit */ in sun8i_codec_attach()
270 if (gpio_pin_get_by_ofw_property(dev, node, "allwinner,pa-gpios", in sun8i_codec_attach()
293 if (sc->clk_gate) in sun8i_codec_detach()
294 clk_release(sc->clk_gate); in sun8i_codec_detach()
296 if (sc->clk_mod) in sun8i_codec_detach()
297 clk_release(sc->clk_mod); in sun8i_codec_detach()
299 if (sc->intrhand != NULL) in sun8i_codec_detach()
300 bus_teardown_intr(sc->dev, sc->res[1], sc->intrhand); in sun8i_codec_detach()
302 bus_release_resources(dev, sun8i_codec_spec, sc->res); in sun8i_codec_detach()
303 mtx_destroy(&sc->mtx); in sun8i_codec_detach()
343 /* Codec LRCK polarity is inverted (datasheet is wrong) */ in sun8i_codec_dai_init()
351 val &= ~AIF1_MSTR_MOD; /* codec is master */ in sun8i_codec_dai_init()
354 val |= AIF1_MSTR_MOD; /* codec is slave */ in sun8i_codec_dai_init()