From patchwork Fri Aug 10 18:39:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1306371 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8E75E3FC33 for ; Fri, 10 Aug 2012 18:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759935Ab2HJSjW (ORCPT ); Fri, 10 Aug 2012 14:39:22 -0400 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]:39367 "EHLO na3sys009aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759915Ab2HJSjT (ORCPT ); Fri, 10 Aug 2012 14:39:19 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKUCVVVWMgbkHDm5ZGPq8JDCU2EAF0S5/y@postini.com; Fri, 10 Aug 2012 11:39:19 PDT Received: by yhmm54 with SMTP id m54so2073723yhm.33 for ; Fri, 10 Aug 2012 11:39:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=EZlIo9dz5QBHl/hU5JDqrbqfV4sZ1hqaYeVapLUecww=; b=NX3hWNhloRNqgUJtxqqZMmuCzHh+dJeDZAKgKV7NkMqneH2XEfnLj/YOtt9vuZ9Er9 Q0ytAIymJfXkIo7+6PIB9leW8u6dfI+k0vAXEgUU6/rmEOS4RsE1lcBXmbFO+IvfocBs rOdio0MVbUfRvQaajQVZmLeE2N76rsFLEBDPCOdjQwEeKzeOGRehS//NKU4mFAuA+cvR hzqxH7UA+e1dWjURfw7/VDjWQk6lYnvYm78MaKYW6f6r+cVRaAGsM+o7yZ+NBn4ONIXP bve0asKHcyAx781i6JsJp8IKgVSGraDvzjF+AaarpFttMsjD+q8+ay3W2atb5+YEpPDS eFCQ== Received: by 10.66.74.97 with SMTP id s1mr8213802pav.11.1344623956145; Fri, 10 Aug 2012 11:39:16 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id sj5sm3818345pbc.30.2012.08.10.11.39.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 11:39:15 -0700 (PDT) From: Kevin Hilman To: Paul Walmsley , linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/3] ARM: OMAP: omap_device: keep track of driver bound status Date: Fri, 10 Aug 2012 11:39:11 -0700 Message-Id: <1344623953-26434-2-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <1344623953-26434-1-git-send-email-khilman@ti.com> References: <1344623953-26434-1-git-send-email-khilman@ti.com> X-Gm-Message-State: ALoCoQmuP1XTRBg+6eAWBjykLIE+1X2Qec83gpzlFRKkql2JZDOzklltIT9LlXSPmObyAty9b+Zy Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use the bus notifier to keep track of driver bound status by adding a new internal field to struct omap_device: _driver_status. This will be useful for follow-up patches which need to know whether or not a driver is bound in order to make intelligent omap_device enable/idle decisions. Cc: Paul Walmsley Signed-off-by: Kevin Hilman --- arch/arm/plat-omap/include/plat/omap_device.h | 2 ++ arch/arm/plat-omap/omap_device.c | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 4327b2c..e7259c0 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -60,6 +60,7 @@ extern struct dev_pm_domain omap_device_pm_domain; * @_dev_wakeup_lat_limit: dev wakeup latency limit in nsec - set by OMAP PM * @_state: one of OMAP_DEVICE_STATE_* (see above) * @flags: device flags + * @_driver_status: one of BUS_NOTIFY_*_DRIVER from * * Integrates omap_hwmod data into Linux platform_device. * @@ -73,6 +74,7 @@ struct omap_device { struct omap_device_pm_latency *pm_lats; u32 dev_wakeup_lat; u32 _dev_wakeup_lat_limit; + unsigned long _driver_status; u8 pm_lats_cnt; s8 pm_lat_level; u8 hwmods_cnt; diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index c490240..1d1b5ff 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -385,17 +385,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb, unsigned long event, void *dev) { struct platform_device *pdev = to_platform_device(dev); + struct omap_device *od; switch (event) { - case BUS_NOTIFY_ADD_DEVICE: - if (pdev->dev.of_node) - omap_device_build_from_dt(pdev); - break; - case BUS_NOTIFY_DEL_DEVICE: if (pdev->archdata.od) omap_device_delete(pdev->archdata.od); break; + case BUS_NOTIFY_ADD_DEVICE: + if (pdev->dev.of_node) + omap_device_build_from_dt(pdev); + /* fall through */ + default: + od = to_omap_device(pdev); + if (od) + od->_driver_status = event; } return NOTIFY_DONE;