blob: fc60d00442a8cb14ec9837faa2dff6de727349af [file] [log] [blame]
Daniel Lezcano03fc66b2011-08-25 15:46:13 +02001/*******************************************************************************
2 * Copyright (C) 2010, Linaro Limited.
3 *
4 * This file is part of PowerDebug.
5 *
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors:
12 * Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation)
13 * - initial API and implementation
14 *******************************************************************************/
15
16#ifndef _GNU_SOURCE
17#define _GNU_SOURCE
18#include <stdio.h>
19#undef _GNU_SOURCE
20#endif
21#include <mntent.h>
22#include <string.h>
23#include <stdbool.h>
24#include <stdlib.h>
25#include <unistd.h>
26#include <sys/param.h>
27#include <sys/stat.h>
28
29#include "powerdebug.h"
30#include "display.h"
31#include "tree.h"
32#include "utils.h"
33
34#define SYSFS_GPIO "/sys/class/gpio"
35
36static struct tree *gpio_tree = NULL;
37
38static int gpio_display(bool refresh)
39{
40 return 0;
41}
42
43static int gpio_select(void)
44{
45 return 0;
46}
47
48static int gpio_find(const char *name)
49{
50 return 0;
51}
52
53static int gpio_selectf(void)
54{
55 return 0;
56}
57
58static struct display_ops gpio_ops = {
59 .display = gpio_display,
60 .select = gpio_select,
61 .find = gpio_find,
62 .selectf = gpio_selectf,
63};
64
65static inline int read_gpio_cb(struct tree *t, void *data)
66{
67 return 0;
68}
69
70static int read_gpio_info(struct tree *tree)
71{
72 return 0;
73}
74
75static int fill_gpio_cb(struct tree *t, void *data)
76{
77 return 0;
78}
79
80static int fill_gpio_tree(void)
81{
82 return 0;
83}
84
85int gpio_dump(void)
86{
87 return 0;
88}
89
90/*
91 * Initialize the gpio framework
92 */
93int gpio_init(void)
94{
95 gpio_tree = tree_load(SYSFS_GPIO, NULL, false);
96 if (!gpio_tree)
97 return -1;
98
99 if (fill_gpio_tree())
100 return -1;
101
102 return display_register(GPIO, &gpio_ops);
103}