From patchwork Fri Feb 15 12:44:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14848 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 0956B23E2E for ; Fri, 15 Feb 2013 12:45:50 +0000 (UTC) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by fiordland.canonical.com (Postfix) with ESMTP id 9D56EA1828F for ; Fri, 15 Feb 2013 12:45:49 +0000 (UTC) Received: by mail-ve0-f171.google.com with SMTP id b10so3018104vea.30 for ; Fri, 15 Feb 2013 04:45:49 -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=VPyxlH/IeMt4zjzOfDyvIxXmgbLmpYlHwa8sn/Mqifs=; b=JmN474DHTd9uV0yC4VkIkVrAQp7vqrRgHjKqBrP0GvdzHkcZDiz6MdFNUjGE/XeWTa ZyOwx+n7PNWOCj5WSzEpGmrejGUX9y6UCnhbKmiGo8I/LC3BOXtR2zIGFUYreZ8TzNi8 6Bd4+mJ6YIKmTU9j4hbDubYbDm+1oH2Gr+4gBnY/tt8w2pN5jmQfX7280RghAb2XHh9t nnR7OYO3+QzsphJNnJ6DAKOLoKg71FZsQTzkM3d5iV1H1dsN/A1aIu2vf/Da5Yu46vp5 8iMPyAl/9E2IAPrbbSANc3ZEp8P3HUkqw5fJnKYBHX5cT7sl4EaE7W4aRX5JcPPuyW1y 78Vw== X-Received: by 10.52.175.66 with SMTP id by2mr2629977vdc.53.1360932349089; Fri, 15 Feb 2013 04:45:49 -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.221.4.5 with SMTP id oa5csp10803vcb; Fri, 15 Feb 2013 04:45:48 -0800 (PST) X-Received: by 10.180.80.74 with SMTP id p10mr3870799wix.19.1360932347241; Fri, 15 Feb 2013 04:45:47 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id bo1si7609541wjb.60.2013.02.15.04.45.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:47 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.175; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.175 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-wi0-f175.google.com with SMTP id l13so1100750wie.2 for ; Fri, 15 Feb 2013 04:45:46 -0800 (PST) X-Received: by 10.194.60.5 with SMTP id d5mr4118149wjr.4.1360932346691; Fri, 15 Feb 2013 04:45:46 -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 bs6sm5133904wib.4.2013.02.15.04.45.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:45 -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, cbouatmailru@gmail.com, sameo@linux.intel.com, Lee Jones Subject: [PATCH 03/40] abx500-chargalg: Store the AB8500 MFD parent device for platform differentiation Date: Fri, 15 Feb 2013 12:44:33 +0000 Message-Id: <1360932310-30065-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> References: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQl/WmGypPw+4yjSCtcLPAMk7kdlat4nhRwHB/RargDoQI1uHwiMjyERxsYdAi2SaCCWJaxl Any platform can be dynamically probed for model and version number provided the AB8500 MFD parent device pointer is available. This patch obtains that pointer and stores it in a locally controlled struct for later use. Signed-off-by: Lee Jones --- drivers/power/abx500_chargalg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index f043c08..31507bf 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c @@ -204,6 +204,7 @@ enum maxim_ret { * @batt_data: data of the battery * @susp_status: current charger suspension status * @bm: Platform specific battery management information + * @parent: pointer to the struct abx500 * @chargalg_psy: structure that holds the battery properties exposed by * the charging algorithm * @events: structure for information about events triggered @@ -227,6 +228,7 @@ struct abx500_chargalg { struct abx500_chargalg_charger_info chg_info; struct abx500_chargalg_battery_data batt_data; struct abx500_chargalg_suspension_status susp_status; + struct ab8500 *parent; struct abx500_bm_data *bm; struct power_supply chargalg_psy; struct ux500_charger *ac_chg; @@ -1873,8 +1875,9 @@ static int abx500_chargalg_probe(struct platform_device *pdev) } } - /* get device struct */ + /* get device struct and parent */ di->dev = &pdev->dev; + di->parent = dev_get_drvdata(pdev->dev.parent); /* chargalg supply */ di->chargalg_psy.name = "abx500_chargalg";