Lines Matching +full:8 +full:dev

41 #include <dev/ofw/ofw_bus.h>
42 #include <dev/ofw/ofw_bus_subr.h>
44 #include <dev/clk/clk.h>
45 #include <dev/hwreset/hwreset.h>
47 #include <dev/gpio/gpiobusvar.h>
50 #include <dev/sound/pcm/sound.h>
51 #include <dev/sound/fdt/audio_dai.h>
56 #define AIF1CLK_SRC_MASK (3 << 8)
57 #define AIF1CLK_SRC_PLL (2 << 8)
69 #define AIF_FS_48KHZ (8 << 12)
100 #define AIF1R_MXR_SRC_MASK (0xf << 8)
101 #define AIF1R_MXR_SRC_AIF1 (0x8 << 8)
102 #define AIF1R_MXR_SRC_ADC (0x2 << 8)
108 #define HMIC_CTRL1_N_MASK (0xf << 8)
109 #define HMIC_CTRL1_N(n) (((n) & 0xf) << 8)
115 #define HMIC_CTRL2_MDATA_THRES __BITS(12,8)
129 #define DACR_MXR_SRC_MASK (0xf << 8)
130 #define DACR_MXR_SRC_AIF1_DAC0R (0x8 << 8)
144 device_t dev; member
157 static int sun8i_codec_probe(device_t dev);
158 static int sun8i_codec_attach(device_t dev);
159 static int sun8i_codec_detach(device_t dev);
162 sun8i_codec_probe(device_t dev) in sun8i_codec_probe() argument
164 if (!ofw_bus_status_okay(dev)) in sun8i_codec_probe()
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()
175 sun8i_codec_attach(device_t dev) in sun8i_codec_attach() argument
183 sc = device_get_softc(dev); in sun8i_codec_attach()
184 sc->dev = dev; in sun8i_codec_attach()
185 node = ofw_bus_get_node(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()
190 device_printf(dev, "cannot allocate resources for device\n"); in sun8i_codec_attach()
195 error = clk_get_by_ofw_name(dev, 0, "mod", &sc->clk_mod); in sun8i_codec_attach()
197 device_printf(dev, "cannot get \"mod\" clock\n"); in sun8i_codec_attach()
201 error = clk_get_by_ofw_name(dev, 0, "bus", &sc->clk_gate); in sun8i_codec_attach()
203 device_printf(dev, "cannot get \"bus\" clock\n"); in sun8i_codec_attach()
209 device_printf(dev, "cannot enable \"bus\" clock\n"); in sun8i_codec_attach()
270 if (gpio_pin_get_by_ofw_property(dev, node, "allwinner,pa-gpios", in sun8i_codec_attach()
274 device_printf(dev, "failed to unmute PA\n"); in sun8i_codec_attach()
277 OF_device_register_xref(OF_xref_from_node(node), dev); in sun8i_codec_attach()
282 sun8i_codec_detach(dev); in sun8i_codec_attach()
287 sun8i_codec_detach(device_t dev) in sun8i_codec_detach() argument
291 sc = device_get_softc(dev); 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()
309 sun8i_codec_dai_init(device_t dev, uint32_t format) in sun8i_codec_dai_init() argument
315 sc = device_get_softc(dev); in sun8i_codec_dai_init()
372 sun8i_codec_dai_trigger(device_t dev, int go, int pcm_dir) in sun8i_codec_dai_trigger() argument
379 sun8i_codec_dai_setup_mixer(device_t dev, device_t pcmdev) in sun8i_codec_dai_setup_mixer() argument