From patchwork Fri Sep 7 11:14:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11245 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 3758723F25 for ; Fri, 7 Sep 2012 11:15:35 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id BBA7EA18DBC for ; Fri, 7 Sep 2012 11:15:34 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so2861152iaf.11 for ; Fri, 07 Sep 2012 04:15:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Ykw/4tqyIlrcl2EpuGqRNJGfvNOt4x66J5C+7SN3cJA=; b=Db3LwlDmpoYP0h2FuUc2XdCrQqkRVClX/56yhI3u/bsT24P96qd3a4zqbQOXDqNCr7 1T/VRIYxvJaJIMOjonQRX/skU7y5Fyl+6+VQuGcvxcSkCvQRSwSO4B0FUkmysVa9uNsW WscbIQrFNx3rRhS6PWK/cbVB7l7qjzTJ+F1/mXE9qrB1qcvuOAopeRSB5CjVJQuuIOzq h7O8fVR/1DLgCkTgi/q52B/7Hl4lrj9CzfTknEU08vQOko3eWufTx8U4zqtaUB2lyDNC x3QwTmWIXwPRmi+5oNQzpNIB5pb5R9zsLtMY8Q0R+6zX2JsJ7DfUK8T9OIWr14eWHHaN 0MGw== Received: by 10.50.237.41 with SMTP id uz9mr7965572igc.43.1347016534546; Fri, 07 Sep 2012 04:15:34 -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.50.184.232 with SMTP id ex8csp373454igc; Fri, 7 Sep 2012 04:15:33 -0700 (PDT) Received: by 10.181.13.164 with SMTP id ez4mr3973374wid.21.1347016532976; Fri, 07 Sep 2012 04:15:32 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id r48si6536163weo.46.2012.09.07.04.15.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 04:15:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 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-f172.google.com with SMTP id hi8so1262875wib.13 for ; Fri, 07 Sep 2012 04:15:32 -0700 (PDT) Received: by 10.180.84.164 with SMTP id a4mr11555117wiz.12.1347016532432; Fri, 07 Sep 2012 04:15:32 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id k20sm9151505wiv.11.2012.09.07.04.15.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Sep 2012 04:15:31 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, Lee Jones , linux-i2c@vger.kernel.org, Wolfram Sang Subject: [PATCH 12/19] i2c-nomadik: Register sub-devices when passed via Device Tree Date: Fri, 7 Sep 2012 12:14:52 +0100 Message-Id: <1347016499-29354-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347016499-29354-1-git-send-email-lee.jones@linaro.org> References: <1347016499-29354-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnSFCmas7RElbCyWw3Y45k61vh2DiwkwVZ2Q6IVJCTJWZ/JFo6R7dLPImnZ8DwG6QQ3RDIS Each I2C device can be correctly probed already using Device Tree, but the sub-devices still have to be registered by calls to i2c_register_board_info(). After this patch, each sub-device can be registered directly from Device Tree instead, removing the requirement for the aforementioned calls from platform code. CC: linux-i2c@vger.kernel.org CC: Wolfram Sang Signed-off-by: Lee Jones --- drivers/i2c/busses/i2c-nomadik.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 5d1a970..01231c2 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -26,6 +26,7 @@ #include #include #include +#include #define DRIVER_NAME "nmk-i2c" @@ -998,6 +999,7 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) } adap = &dev->adap; + adap->dev.of_node = np; adap->dev.parent = &adev->dev; adap->owner = THIS_MODULE; adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; @@ -1027,6 +1029,8 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) goto err_add_adap; } + of_i2c_register_devices(adap); + pm_runtime_put(&adev->dev); return 0;