blob: d2c0954f48c48b4473cb438085bbe0e76e024877 [file] [log] [blame]
Amit Arora39f29542010-09-14 12:03:22 +05301/*******************************************************************************
Amit Kucheriac0e17fc2011-01-17 09:35:52 +02002 * Copyright (C) 2010, Linaro Limited.
Amit Arora39f29542010-09-14 12:03:22 +05303 *
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
Amit Arorae9e16b02010-08-03 10:15:20 +053016#include <stdio.h>
17#include <stdlib.h>
18#include <unistd.h>
19#include <string.h>
20#include <dirent.h>
21#include <getopt.h>
22#include <errno.h>
Amit Arora47fd9182010-08-24 13:26:06 +053023#include <ncurses.h>
Amit Arorae9e16b02010-08-03 10:15:20 +053024
Amit Kucheria5bd36f82011-01-24 13:15:27 +020025#define VERSION "0.4.1"
Amit Arorafefe8bf2010-08-05 13:31:20 +053026
Amit Arorac93e0712010-10-07 13:51:53 +053027#define TOTAL_FEATURE_WINS 3 /* Regulator, Clock and Sensor (for now) */
Amit Kucheriaee851a12011-01-12 04:57:48 +053028enum {CLOCK, REGULATOR, SENSOR};
Amit Aroraa06a7302010-12-02 15:59:37 +053029enum {CLOCK_SELECTED = 1, REFRESH_WINDOW};
Amit Arorae9e16b02010-08-03 10:15:20 +053030
Daniel Lezcanoc7891942011-06-08 23:30:00 +020031extern void read_and_dump_clock_info(char *clk);
Daniel Lezcanob2565a82011-06-08 23:30:00 +020032extern int read_clock_info(char *clkpath);
Daniel Lezcano897f7332011-03-26 22:06:06 +010033extern void find_parents_for_clock(char *clkname, int complete);
Amit Arora24ed7d12010-09-14 12:12:58 +053034extern int read_and_print_clock_info(int verbose, int hrow, int selected);
Amit Aroraac4e8652010-11-09 11:16:53 +053035extern void print_clock_info(int verbose, int hrow, int selected);
Amit Aroradca56d02010-08-05 14:57:22 +053036extern void print_string_val(char *name, char *val);
Amit Aroraac4e8652010-11-09 11:16:53 +053037extern void print_clock_header(void);
Amit Aroraac4e8652010-11-09 11:16:53 +053038extern void print_one_clock(int line, char *str, int bold, int highlight);
Amit Arora47fd9182010-08-24 13:26:06 +053039
Amit Arora17552782010-12-02 12:23:14 +053040extern void get_sensor_info(char *path, char *name, char *sensor, int verbose);
41extern int read_and_print_sensor_info(int verbose);
42extern void print_sensor_header(void);
43
Amit Arorac93e0712010-10-07 13:51:53 +053044extern void killall_windows(int all);
Daniel Lezcano558a6d52011-03-23 14:37:41 +010045extern void show_header(int selectedwindow);
46extern void create_windows(int selectedwindow);
47extern void create_selectedwindow(int selectedwindow);
Daniel Lezcano691d5562011-03-26 22:05:57 +010048
49struct regulator_info;
Daniel Lezcano833b63a2011-03-26 22:06:00 +010050extern void show_regulator_info(struct regulator_info *reg_info,
51 int nr_reg, int verbose);