From patchwork Wed Nov 12 00:25:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 40628 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 965B2205DF for ; Wed, 12 Nov 2014 00:33:10 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf7093815lab.9 for ; Tue, 11 Nov 2014 16:33:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=CGTY11WglC+KzSvGawyXG4iPhMVKz2KxvVjvAZ4xrVI=; b=dde5Huy//0SrJBa1o8JGYkRuaLYxqlpQORzN+bvqK3Y9tUGvf0zDK4V0e8Vrib6NuN +ifjs+tTKx0Cbuw2ZkV7fYRYVNuKl6xFMgwfREbhqG9xXfi0/gMu9WJ4ey93WTJwNQ3Q mLRUh771bIS2025t1KA5RZNn2cgTIzBRXcEISA1xMCAgXm9ya1QvNAQu13MkUbVKXlij yj4PDP3FFE/VBkTbKVOPU30udLR1dLTaXG47g83sk1g1LY33r7c7nmfYDgqUqw5KQFIX Bgw5kkK/2IoVvlqhsim8u5Y0Q/ly+KeZ8QQyAtnJhjVQS78pnwSlacrXUOezW+KVcNJi yJEA== X-Gm-Message-State: ALoCoQn/dHUsJxPYJRvyvdXKVx9vWN8qvvfsRKTIJJavc8lM6jendAyKHAC5l2TzP/qArp6SuSxS X-Received: by 10.180.100.100 with SMTP id ex4mr5930237wib.2.1415752389637; Tue, 11 Nov 2014 16:33:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls540961lae.38.gmail; Tue, 11 Nov 2014 16:33:09 -0800 (PST) X-Received: by 10.152.204.99 with SMTP id kx3mr39357807lac.53.1415752389350; Tue, 11 Nov 2014 16:33:09 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id u17si11318507laz.109.2014.11.11.16.33.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Nov 2014 16:33:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so8462893lbv.24 for ; Tue, 11 Nov 2014 16:33:09 -0800 (PST) X-Received: by 10.112.167.200 with SMTP id zq8mr39098119lbb.61.1415752389221; Tue, 11 Nov 2014 16:33:09 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp347527lbc; Tue, 11 Nov 2014 16:33:08 -0800 (PST) X-Received: by 10.229.240.138 with SMTP id la10mr56598986qcb.13.1415752383756; Tue, 11 Nov 2014 16:33:03 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y20si6733633qaf.75.2014.11.11.16.33.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Nov 2014 16:33:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:51600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoLrq-0004e9-Rz for patch@linaro.org; Tue, 11 Nov 2014 19:33:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoLlW-00024U-O6 for qemu-devel@nongnu.org; Tue, 11 Nov 2014 19:26:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoLlQ-0000CH-7N for qemu-devel@nongnu.org; Tue, 11 Nov 2014 19:26:30 -0500 Received: from mail-oi0-f47.google.com ([209.85.218.47]:57336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoLlP-0000BZ-WC for qemu-devel@nongnu.org; Tue, 11 Nov 2014 19:26:24 -0500 Received: by mail-oi0-f47.google.com with SMTP id a3so7849146oib.20 for ; Tue, 11 Nov 2014 16:26:23 -0800 (PST) X-Received: by 10.202.79.13 with SMTP id d13mr4546974oib.71.1415751983675; Tue, 11 Nov 2014 16:26:23 -0800 (PST) Received: from gbellows-linaro.bellowshome.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id d3sm6239765obs.18.2014.11.11.16.26.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Nov 2014 16:26:23 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, peter.maydell@linaro.org, christoffer.dall@linaro.org, alex.bennee@linaro.org Date: Tue, 11 Nov 2014 18:25:56 -0600 Message-Id: <1415751963-4081-9-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415751963-4081-1-git-send-email-greg.bellows@linaro.org> References: <1415751963-4081-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.218.47 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v1 08/15] android-console: Add header for battery externs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: greg.bellows@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Added goldfish_battery.h to share power and battery constants and externs between the Goldfish battery code and the Android console code. Signed-off-by: Greg Bellows --- hw/misc/goldfish_battery.c | 4 +-- include/hw/misc/goldfish_battery.h | 71 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 include/hw/misc/goldfish_battery.h diff --git a/hw/misc/goldfish_battery.c b/hw/misc/goldfish_battery.c index 11a2561..c956eb2 100644 --- a/hw/misc/goldfish_battery.c +++ b/hw/misc/goldfish_battery.c @@ -12,6 +12,7 @@ #include "hw/hw.h" #include "hw/sysbus.h" #include "qemu/error-report.h" +#include "hw/misc/goldfish_battery.h" enum { /* status register */ @@ -30,9 +31,6 @@ enum { BATTERY_INT_MASK = BATTERY_STATUS_CHANGED | AC_STATUS_CHANGED, }; -const uint32_t POWER_SUPPLY_STATUS_CHARGING = 1; -const uint32_t POWER_SUPPLY_HEALTH_GOOD = 1; - #define TYPE_GOLDFISH_BATTERY "goldfish_battery" #define GOLDFISH_BATTERY(obj) OBJECT_CHECK(struct goldfish_battery_state, (obj), TYPE_GOLDFISH_BATTERY) diff --git a/include/hw/misc/goldfish_battery.h b/include/hw/misc/goldfish_battery.h new file mode 100644 index 0000000..85a9f2f --- /dev/null +++ b/include/hw/misc/goldfish_battery.h @@ -0,0 +1,71 @@ +/* Copyright (C) 2007-2013 The Android Open Source Project +** +** This software is licensed under the terms of the GNU General Public +** License version 2, as published by the Free Software Foundation, and +** may be copied, distributed, and modified under those terms. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +*/ +#ifndef _HW_GOLDFISH_BATTERY_H +#define _HW_GOLDFISH_BATTERY_H + +enum { + POWER_SUPPLY_STATUS_UNKNOWN = 0, + POWER_SUPPLY_STATUS_CHARGING, + POWER_SUPPLY_STATUS_DISCHARGING, + POWER_SUPPLY_STATUS_NOT_CHARGING, + POWER_SUPPLY_STATUS_FULL, +}; + +enum { + POWER_SUPPLY_HEALTH_UNKNOWN = 0, + POWER_SUPPLY_HEALTH_GOOD, + POWER_SUPPLY_HEALTH_OVERHEAT, + POWER_SUPPLY_HEALTH_DEAD, + POWER_SUPPLY_HEALTH_OVERVOLTAGE, + POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, +}; + + +enum power_supply_property { + /* Properties of type `int' */ + POWER_SUPPLY_PROP_STATUS = 0, + POWER_SUPPLY_PROP_HEALTH, + POWER_SUPPLY_PROP_PRESENT, + POWER_SUPPLY_PROP_ONLINE, + POWER_SUPPLY_PROP_TECHNOLOGY, + POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, + POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, + POWER_SUPPLY_PROP_VOLTAGE_NOW, + POWER_SUPPLY_PROP_VOLTAGE_AVG, + POWER_SUPPLY_PROP_CURRENT_NOW, + POWER_SUPPLY_PROP_CURRENT_AVG, + POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, + POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN, + POWER_SUPPLY_PROP_CHARGE_FULL, + POWER_SUPPLY_PROP_CHARGE_EMPTY, + POWER_SUPPLY_PROP_CHARGE_NOW, + POWER_SUPPLY_PROP_CHARGE_AVG, + POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, + POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, + POWER_SUPPLY_PROP_ENERGY_FULL, + POWER_SUPPLY_PROP_ENERGY_EMPTY, + POWER_SUPPLY_PROP_ENERGY_NOW, + POWER_SUPPLY_PROP_ENERGY_AVG, + POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ + POWER_SUPPLY_PROP_CAPACITY_LEVEL, + POWER_SUPPLY_PROP_TEMP, + POWER_SUPPLY_PROP_TEMP_AMBIENT, + POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, + POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, + POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, + POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, + /* Properties of type `const char *' */ + POWER_SUPPLY_PROP_MODEL_NAME, + POWER_SUPPLY_PROP_MANUFACTURER, +}; + +#endif /* _HW_GOLDFISH_BATTERY_H */