Lines Matching +full:mclk +full:- +full:src

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
143 { "rockchip,rk3328-codec", 1},
151 clk_t mclk; member
157 #define RKCODEC_LOCK(sc) mtx_lock(&(sc)->mtx)
158 #define RKCODEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx)
159 #define RKCODEC_READ(sc, reg) bus_read_4((sc)->res, (reg))
160 #define RKCODEC_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val))
195 SYSCON_WRITE_4(sc->grf, GRF_SOC_CON10, val); in rkcodec_set_mute()
213 if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) in rkcodec_probe()
229 sc->dev = dev; in rkcodec_attach()
231 mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); in rkcodec_attach()
234 sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); in rkcodec_attach()
235 if (!sc->res) { in rkcodec_attach()
243 "rockchip,grf", &sc->grf) != 0) { in rkcodec_attach()
249 SYSCON_WRITE_4(sc->grf, GRF_SOC_CON2, val); in rkcodec_attach()
252 SYSCON_WRITE_4(sc->grf, GRF_SOC_CON10, val); in rkcodec_attach()
254 error = clk_get_by_ofw_name(dev, 0, "pclk", &sc->pclk); in rkcodec_attach()
260 error = clk_get_by_ofw_name(dev, 0, "mclk", &sc->mclk); in rkcodec_attach()
262 device_printf(dev, "could not get mclk clock\n"); in rkcodec_attach()
266 error = clk_enable(sc->pclk); in rkcodec_attach()
268 device_printf(sc->dev, "could not enable pclk clock\n"); in rkcodec_attach()
272 error = clk_enable(sc->mclk); in rkcodec_attach()
274 device_printf(sc->dev, "could not enable mclk clock\n"); in rkcodec_attach()
279 error = clk_set_freq(sc->mclk, DEFAULT_RATE, 0); in rkcodec_attach()
281 device_printf(sc->dev, "could not set frequency for mclk clock\n"); in rkcodec_attach()
286 /* TODO: handle mute-gpios */ in rkcodec_attach()
385 if (sc->res) in rkcodec_detach()
386 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->res); in rkcodec_detach()
387 mtx_destroy(&sc->mtx); in rkcodec_detach()
454 rkcodec_mixer_setrecsrc(struct snd_mixer *m, unsigned src) in rkcodec_mixer_setrecsrc() argument