Lines Matching +full:power +full:- +full:off +full:- +full:time +full:- +full:sec

1 // SPDX-License-Identifier: GPL-2.0
11 * Split off a header file and maybe move it to a different
21 #include <linux/time.h>
34 #include <asm/time.h>
63 #define SENSOR_HW_ERROR -1
64 #define SENSOR_BUSY -2
65 #define SENSOR_NOT_EXIST -3
66 #define SENSOR_DR_ENTITY -9000
97 #define TONE_FREQUENCY 0x0001 /* 0 - 1000 (HZ)*/
98 #define TONE_VOLUME 0x0002 /* 0 - 100 (%) */
108 /* 9003 - 9004: Vendor specific */
109 /* 9006 - 9999: Vendor specific */
114 #define SENSOR_PREFIX "ibm,sensor-"
130 static unsigned long power_on_time = 0; /* Save the time the user set */
234 return -ENODEV; in proc_rtas_init()
238 return -ENODEV; in proc_rtas_init()
264 return -EINVAL; in parse_number()
267 return -EFAULT; in parse_number()
275 /* POWER-ON-TIME */
286 power_on_time = nowtime; /* save the time */ in ppc_rtas_poweron_write()
290 error = rtas_call(rtas_token("set-time-for-power-on"), 7, 1, NULL, in ppc_rtas_poweron_write()
294 printk(KERN_WARNING "error: setting poweron time returned: %s\n", in ppc_rtas_poweron_write()
302 seq_printf(m, "Power on time not set\n"); in ppc_rtas_poweron_show()
317 count = MAX_LINELENGTH -1; in ppc_rtas_progress_write()
319 return -EFAULT; in ppc_rtas_progress_write()
353 error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, in ppc_rtas_clock_write()
365 int error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); in ppc_rtas_clock_show()
372 unsigned int year, mon, day, hour, min, sec; in ppc_rtas_clock_show() local
374 hour = ret[3]; min = ret[4]; sec = ret[5]; in ppc_rtas_clock_show()
376 mktime64(year, mon, day, hour, min, sec)); in ppc_rtas_clock_show()
388 int get_sensor_state = rtas_token("get-sensor-state"); in ppc_rtas_sensors_show()
405 sprintf (rstr, SENSOR_PREFIX"%04d", p->token); in ppc_rtas_sensors_show()
409 for (j = 0, offs = 0; j <= p->quant; j++) { in ppc_rtas_sensors_show()
411 p->token, j); in ppc_rtas_sensors_show()
433 utmp = of_get_property(rtas_node, "rtas-sensors", &len); in ppc_rtas_find_all_sensors()
435 printk (KERN_ERR "error: could not get rtas-sensors\n"); in ppc_rtas_find_all_sensors()
489 const char * key_switch[] = { "Off\t", "Normal\t", "Secure\t", in ppc_rtas_process_sensor()
497 "EPOW Reset", "Cooling warning", "Power warning", in ppc_rtas_process_sensor()
499 "EPOW power off" }; in ppc_rtas_process_sensor()
514 switch (s->token) { in ppc_rtas_process_sensor()
545 seq_printf(m, "Power source:\t"); in ppc_rtas_process_sensor()
619 s->token); in ppc_rtas_process_sensor()
660 seq_printf(m, "- %c", c[1]); in check_location()
672 * ${LETTER}${NUMBER}[[-/]${LETTER}${NUMBER} [ ... ] ]
680 else if (*c == '/' || *c == '-') in check_location_string()
693 seq_printf(m, "---");/* does not have a location */ in get_location_code()
700 /* INDICATORS - Tone Frequency */
711 error = rtas_call(rtas_token("set-indicator"), 3, 1, NULL, in ppc_rtas_tone_freq_write()
725 /* INDICATORS - Tone Volume */
739 error = rtas_call(rtas_token("set-indicator"), 3, 1, NULL, in ppc_rtas_tone_volume_write()
754 * ppc_rtas_rmo_buf_show() - Describe RTAS-addressable region for user space.
756 * Base + size description of a range of RTAS-addressable memory set