1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(DATA61_BSD)
11 */
12#include <stdint.h>
13#include <platsupport/mux.h>
14#include <utils/attribute.h>
15#include "../../services.h"
16
17struct apq8064_mux_regs {
18    int dummy;
19};
20
21static struct apq8064_mux {
22    volatile struct apq8064_mux_regs*    mux;
23} _mux;
24
25static inline struct apq8064_mux* get_mux_priv(mux_sys_t* mux) {
26    return (struct apq8064_mux*)mux->priv;
27}
28
29static inline void set_mux_priv(mux_sys_t* mux, struct apq8064_mux* apq8064_mux)
30{
31    assert(mux != NULL);
32    assert(apq8064_mux != NULL);
33    mux->priv = apq8064_mux;
34}
35
36static int
37apq8064_mux_feature_enable(mux_sys_t* mux, mux_feature_t mux_feature, UNUSED enum mux_gpio_dir mgd)
38{
39    struct apq8064_mux* m;
40    if (mux == NULL || mux->priv == NULL) {
41        return -1;
42    }
43    m = get_mux_priv(mux);
44
45    switch (mux_feature) {
46    default:
47        (void)m;
48        return -1;
49    }
50}
51
52static int
53apq8064_mux_init_common(mux_sys_t* mux)
54{
55    set_mux_priv(mux, &_mux);
56    mux->feature_enable = &apq8064_mux_feature_enable;
57    return 0;
58}
59
60int
61apq8064_mux_init(void* bank1,
62                 mux_sys_t* mux)
63{
64    (void)bank1;
65    return apq8064_mux_init_common(mux);
66}
67
68int
69mux_sys_init(ps_io_ops_t* io_ops, UNUSED void *dependencies, mux_sys_t* mux)
70{
71    (void)io_ops;
72    return apq8064_mux_init_common(mux);
73}
74