From patchwork Mon Jan 21 12:03:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14155 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 2595C23E33 for ; Mon, 21 Jan 2013 12:05:00 +0000 (UTC) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by fiordland.canonical.com (Postfix) with ESMTP id B575CA18CF5 for ; Mon, 21 Jan 2013 12:04:59 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id m8so4813938vcd.37 for ; Mon, 21 Jan 2013 04:04:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=na1gqhKrbeYYxuG8iU/TAc6/4cvyOZ4VeG4TetWjFYs=; b=CTzmYJj8iGGMFb6HVvmcMKSr7u3K657jW8tKBVYxFUElPQ9tncNvqix8sntJVj61lA T9cOKtp6IFDDuL0fveS2qA6lMvJG6Tk2EQcXoLxKQ/xnWNypFkY2aKVnHSS2eHzKshob X78TmYBFSNC5nipUZhceVyQRJ0hRpwlWd2HaHc0QJL58qcER0ucK2RPtp5m9Kv/Z1bt+ o7AOafET8gUr3ZfA4ZeK5aUCW3lj88jAV+8vYaC0wmDPDHG2PTvE8K7hGDeZmfs6dY4U D9vGPyvyQJiQqiuM037tKyM1ivAuM0+sH2MAY82/VO0vvo3BTCJ8KHxBdHnZLiXvZZnt aaDw== X-Received: by 10.52.34.108 with SMTP id y12mr12644334vdi.8.1358769899284; Mon, 21 Jan 2013 04:04:59 -0800 (PST) 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.58.145.101 with SMTP id st5csp197726veb; Mon, 21 Jan 2013 04:04:58 -0800 (PST) X-Received: by 10.195.13.67 with SMTP id ew3mr25789279wjd.59.1358769880610; Mon, 21 Jan 2013 04:04:40 -0800 (PST) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by mx.google.com with ESMTPS id q13si3798773wiv.127.2013.01.21.04.04.40 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 04:04:40 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.44 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.44 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wg0-f44.google.com with SMTP id dr12so3707314wgb.35 for ; Mon, 21 Jan 2013 04:04:40 -0800 (PST) X-Received: by 10.194.238.33 with SMTP id vh1mr25960394wjc.15.1358769874092; Mon, 21 Jan 2013 04:04:34 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id i2sm16575305wiw.3.2013.01.21.04.04.32 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Jan 2013 04:04:33 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, anton.vorontsov@linaro.org, cbou@mail.ru, Loic Pallardy , Lee Jones , Rajkumar Kasirajan Subject: [PATCH 09/24] pm2301: Remove volt_now & curr_now properties Date: Mon, 21 Jan 2013 12:03:45 +0000 Message-Id: <1358769840-4763-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358769840-4763-1-git-send-email-lee.jones@linaro.org> References: <1358769840-4763-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkxjzGVyQ6ONZSV/duaPEQQMcPPTdkpngTU2BzAtqVjl3xOoOSysvwmSZU6YPrPbbemGimB From: Loic Pallardy There is no support to measure the main charger voltage and current using AB9540 gpadc. Therefore this has been removed from the driver. Signed-off-by: Lee Jones Signed-off-by: Rajkumar Kasirajan Reviewed-by: Michel JAOUEN Reviewed-by: Rabin VINCENT Tested-by: Michel JAOUEN --- drivers/power/pm2301_charger.c | 35 ----------------------------------- drivers/power/pm2301_charger.h | 1 - 2 files changed, 36 deletions(-) diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c index 316d5f0..16d8cfe 100644 --- a/drivers/power/pm2301_charger.c +++ b/drivers/power/pm2301_charger.c @@ -47,9 +47,7 @@ static enum power_supply_property pm2xxx_charger_ac_props[] = { POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_ONLINE, - POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_VOLTAGE_AVG, - POWER_SUPPLY_PROP_CURRENT_NOW, }; static int pm2xxx_charger_voltage_map[] = { @@ -438,19 +436,6 @@ static irqreturn_t pm2xxx_irq_int(int irq, void *data) return IRQ_HANDLED; } -static int pm2xxx_charger_get_ac_voltage(struct pm2xxx_charger *pm2) -{ - int vch = 0; - - if (pm2->ac.charger_connected) { - vch = ab8500_gpadc_convert(pm2->gpadc, MAIN_CHARGER_V); - if (vch < 0) - dev_err(pm2->dev, "%s gpadc conv failed,\n", __func__); - } - - return vch; -} - static int pm2xxx_charger_get_ac_cv(struct pm2xxx_charger *pm2) { int ret = 0; @@ -473,19 +458,6 @@ out: return ret; } -static int pm2xxx_charger_get_ac_current(struct pm2xxx_charger *pm2) -{ - int ich = 0; - - if (pm2->ac.charger_online) { - ich = ab8500_gpadc_convert(pm2->gpadc, MAIN_CHARGER_C); - if (ich < 0) - dev_err(pm2->dev, "%s gpadc conv failed\n", __func__); - } - - return ich; -} - static int pm2xxx_current_to_regval(int curr) { int i; @@ -585,17 +557,10 @@ static int pm2xxx_charger_ac_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_PRESENT: val->intval = pm2->ac.charger_connected; break; - case POWER_SUPPLY_PROP_VOLTAGE_NOW: - pm2->ac.charger_voltage = pm2xxx_charger_get_ac_voltage(pm2); - val->intval = pm2->ac.charger_voltage * 1000; - break; case POWER_SUPPLY_PROP_VOLTAGE_AVG: pm2->ac.cv_active = pm2xxx_charger_get_ac_cv(pm2); val->intval = pm2->ac.cv_active; break; - case POWER_SUPPLY_PROP_CURRENT_NOW: - val->intval = pm2xxx_charger_get_ac_current(pm2) * 1000; - break; default: return -EINVAL; } diff --git a/drivers/power/pm2301_charger.h b/drivers/power/pm2301_charger.h index cc401d7..4bace67 100644 --- a/drivers/power/pm2301_charger.h +++ b/drivers/power/pm2301_charger.h @@ -456,7 +456,6 @@ enum pm2xxx_source_reg_int6 { struct pm2xxx_charger_info { int charger_connected; int charger_online; - int charger_voltage; int cv_active; bool wd_expired; };