Amit Arora | 1755278 | 2010-12-02 12:23:14 +0530 | [diff] [blame] | 1 | /******************************************************************************* |
Amit Kucheria | c0e17fc | 2011-01-17 09:35:52 +0200 | [diff] [blame] | 2 | * Copyright (C) 2010, Linaro Limited. |
Amit Arora | 1755278 | 2010-12-02 12:23:14 +0530 | [diff] [blame] | 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 | * Amit Arora <amit.arora@linaro.org> (IBM Corporation) |
| 13 | * - initial API and implementation |
| 14 | *******************************************************************************/ |
| 15 | |
| 16 | #include <stdio.h> |
| 17 | #include <stdlib.h> |
| 18 | #include <unistd.h> |
| 19 | #include <string.h> |
| 20 | #include <dirent.h> |
| 21 | #include <getopt.h> |
| 22 | |
| 23 | #define VALUE_MAX 16 |
| 24 | |
| 25 | struct regulator_info { |
| 26 | char name[NAME_MAX]; |
| 27 | char state[VALUE_MAX]; |
| 28 | char status[VALUE_MAX]; |
| 29 | char type[VALUE_MAX]; |
| 30 | char opmode[VALUE_MAX]; |
| 31 | int microvolts; |
| 32 | int min_microvolts; |
| 33 | int max_microvolts; |
| 34 | int microamps; |
| 35 | int min_microamps; |
| 36 | int max_microamps; |
| 37 | int requested_microamps; |
| 38 | int num_users; |
Daniel Lezcano | 691d556 | 2011-03-26 22:05:57 +0100 | [diff] [blame] | 39 | }; |
Amit Arora | 1755278 | 2010-12-02 12:23:14 +0530 | [diff] [blame] | 40 | |
Daniel Lezcano | 4aab2fe | 2011-03-26 22:05:53 +0100 | [diff] [blame] | 41 | extern struct regulator_info *regulator_init(int *nr_regulators); |
Daniel Lezcano | 408580e | 2011-03-26 22:05:59 +0100 | [diff] [blame] | 42 | extern int regulator_read_info(struct regulator_info *reg_info, int nr_reg); |
Daniel Lezcano | fac6aea | 2011-03-26 22:05:58 +0100 | [diff] [blame] | 43 | extern void regulator_print_info(struct regulator_info *reg_info, |
| 44 | int nr_reg, int verbose); |