aboutsummaryrefslogtreecommitdiff
path: root/gpio.c
blob: fc60d00442a8cb14ec9837faa2dff6de727349af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*******************************************************************************
 * Copyright (C) 2010, Linaro Limited.
 *
 * This file is part of PowerDebug.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation)
 *       - initial API and implementation
 *******************************************************************************/

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#include <stdio.h>
#undef _GNU_SOURCE
#endif
#include <mntent.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/stat.h>

#include "powerdebug.h"
#include "display.h"
#include "tree.h"
#include "utils.h"

#define SYSFS_GPIO "/sys/class/gpio"

static struct tree *gpio_tree = NULL;

static int gpio_display(bool refresh)
{
	return 0;
}

static int gpio_select(void)
{
	return 0;
}

static int gpio_find(const char *name)
{
	return 0;
}

static int gpio_selectf(void)
{
	return 0;
}

static struct display_ops gpio_ops = {
	.display = gpio_display,
	.select  = gpio_select,
	.find    = gpio_find,
	.selectf = gpio_selectf,
};

static inline int read_gpio_cb(struct tree *t, void *data)
{
	return 0;
}

static int read_gpio_info(struct tree *tree)
{
	return 0;
}

static int fill_gpio_cb(struct tree *t, void *data)
{
	return 0;
}

static int fill_gpio_tree(void)
{
	return 0;
}

int gpio_dump(void)
{
	return 0;
}

/*
 * Initialize the gpio framework
 */
int gpio_init(void)
{
	gpio_tree = tree_load(SYSFS_GPIO, NULL, false);
	if (!gpio_tree)
		return -1;

	if (fill_gpio_tree())
		return -1;

	return display_register(GPIO, &gpio_ops);
}