Browse Source

minion: Include "Frequency" in RPC status

Luke Dashjr 11 years ago
parent
commit
3a09e6db64
1 changed files with 17 additions and 0 deletions
  1. 17 0
      driver-minion.c

+ 17 - 0
driver-minion.c

@@ -513,6 +513,21 @@ void minion_poll(struct thr_info * const chip_thr)
 	timer_set_delay_from_now(&chip_thr->tv_poll, minion_poll_us);
 	timer_set_delay_from_now(&chip_thr->tv_poll, minion_poll_us);
 }
 }
 
 
+static
+struct api_data *minion_get_api_extra_device_status(struct cgpu_info * const proc)
+{
+	struct thr_info * const thr = proc->thr[0];
+	struct minion_chip * const chip = thr->cgpu_data;
+	struct api_data *root = NULL;
+	double d;
+	
+	d = minion_pllcfg_to_freq(chip->pllcfg_asserted);
+	if (d > 0)
+		root = api_add_freq(root, "Frequency", &d, true);
+	
+	return root;
+}
+
 static
 static
 const char *minion_set_clock(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
 const char *minion_set_clock(struct cgpu_info * const proc, const char * const optname, const char * const newvalue, char * const replybuf, enum bfg_set_device_replytype * const out_success)
 {
 {
@@ -605,4 +620,6 @@ struct device_drv minion_drv = {
 	.queue_append = minion_queue_append,
 	.queue_append = minion_queue_append,
 	.queue_flush = minion_queue_flush,
 	.queue_flush = minion_queue_flush,
 	.poll = minion_poll,
 	.poll = minion_poll,
+	
+	.get_api_extra_device_status = minion_get_api_extra_device_status,
 };
 };