From patchwork Wed Jun 15 13:50:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 1938 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BE74224B1C for ; Wed, 15 Jun 2011 13:52:46 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8E6B8A1894A for ; Wed, 15 Jun 2011 13:52:46 +0000 (UTC) Received: by mail-vx0-f180.google.com with SMTP id 12so410110vxk.11 for ; Wed, 15 Jun 2011 06:52:46 -0700 (PDT) Received: by 10.52.98.97 with SMTP id eh1mr91604vdb.7.1308145965172; Wed, 15 Jun 2011 06:52:45 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs126643vdc; Wed, 15 Jun 2011 06:52:44 -0700 (PDT) Received: by 10.216.232.23 with SMTP id m23mr627933weq.26.1308145963668; Wed, 15 Jun 2011 06:52:43 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp05.smtpout.orange.fr [80.12.242.127]) by mx.google.com with ESMTP id g60si1382053wee.110.2011.06.15.06.52.43; Wed, 15 Jun 2011 06:52:43 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.127 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.127; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.127 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([92.134.76.78]) by mwinf5d28 with ME id wDsa1g00D1hMfSL03DsiDn; Wed, 15 Jun 2011 15:52:43 +0200 From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: linaro-dev@lists.linaro.org, patches@linaro.org Subject: [powerdebug 15/22] Encapsulate the display (8) Date: Wed, 15 Jun 2011 15:50:49 +0200 Message-Id: <1308145856-6112-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308145856-6112-1-git-send-email-daniel.lezcano@linaro.org> References: <1308145856-6112-1-git-send-email-daniel.lezcano@linaro.org> We don't have anymore a specific case for each pm block as we use some ops now. Signed-off-by: Daniel Lezcano --- powerdebug.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/powerdebug.c b/powerdebug.c index 5ff675d..28b23b4 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -198,20 +198,16 @@ int mainloop(struct powerdebug_options *options) struct timeval tval; fd_set readfds; - if (options->selectedwindow == REGULATOR) - regulator_display(); - - if (options->selectedwindow == SENSOR) - sensor_display(); if (options->selectedwindow == CLOCK) { if (enter_hit) - clock_toggle_expanded(); - - clock_display(); + display_select(); enter_hit = false; } + display_refresh(); + + FD_ZERO(&readfds); FD_SET(0, &readfds); tval.tv_sec = options->ticktime;