From patchwork Mon Jun 10 21:23:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 2699141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 0C4583FD4F for ; Mon, 10 Jun 2013 21:24:37 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Um9Zk-00064W-5D; Mon, 10 Jun 2013 21:24:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Um9Zc-0004Pc-5D; Mon, 10 Jun 2013 21:24:20 +0000 Received: from mail-bk0-x22f.google.com ([2a00:1450:4008:c01::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Um9ZY-0004Om-1z for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2013 21:24:17 +0000 Received: by mail-bk0-f47.google.com with SMTP id jg1so3353701bkc.20 for ; Mon, 10 Jun 2013 14:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=hR4GQNzym6QiWcT6HLj7eK8cH8OcZNKQ0PHpjAQZ97Q=; b=waNvTKah8BRZO6YVulnHPHo5353mIAUl1dgaNygziPhXs8kt5Q8opnfGRt7irr+wdn vGYDk/h8l7JMYRS4CtehYpo1gxciLSnaKkDuCsTJBCb/nI/u5avYal/dYZNKtdkDFff4 dA4V0RZShoTc5ImxB1Xupi7Pyb0QWh1sXNSWdRDTgBPOogt/fsK2TNcwfuP0PSceXVAr N/Lev3dzmU/e82A6aPw3ehVt0UoFJ/9X646U2GuLgXMR+xunX3Pbjkd0yldQdQb1izKp 7fN1VoIO+cdPuEXl8MzNNrrlBlkC0JdqJ8CyyNOhwicX2sAYbwocvGRmQjkasTH+mCzn SQlA== X-Received: by 10.204.71.200 with SMTP id i8mr1796814bkj.116.1370899432674; Mon, 10 Jun 2013 14:23:52 -0700 (PDT) Received: from topkick.lan (dslc-082-083-251-181.pools.arcor-ip.net. [82.83.251.181]) by mx.google.com with ESMTPSA id tl1sm4544394bkb.7.2013.06.10.14.23.51 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 14:23:51 -0700 (PDT) Received: from picnic.unix.mst.uni-hannover.de (firewall.mst.uni-hannover.de [130.75.30.51]) by topkick.lan (Postfix) with ESMTPSA id CBCF35F973; Mon, 10 Jun 2013 23:22:39 +0200 (CEST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH] drm: encoder_slave: respect of_node on i2c encoder init Date: Mon, 10 Jun 2013 23:23:42 +0200 Message-Id: <1370899422-1281-1-git-send-email-sebastian.hesselbarth@gmail.com> X-Mailer: git-send-email 1.7.2.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130610_172416_231898_CD37F852 X-CRM114-Status: GOOD ( 14.34 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sebastian.hesselbarth[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Russell King - ARM Linux , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Darren Etheridge , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Current DRM slave encoder API conflicts with auto-registration of i2c client when using DT probed clients. To allow DRM slave encoders passed by DT, this patch adds a check to drm_i2c_encoder_init for a non-NULL .of_node on i2c_board_info and calls an of_i2c helper to get the i2c client device instead of registering a new device. Signed-off-by: Sebastian Hesselbarth --- Cc: David Airlie Cc: Russell King - ARM Linux Cc: Darren Etheridge Cc: linux-arm-kernel@lists.infradead.org Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org --- drivers/gpu/drm/drm_encoder_slave.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index 0cfb60f..36c0aa7 100644 --- a/drivers/gpu/drm/drm_encoder_slave.c +++ b/drivers/gpu/drm/drm_encoder_slave.c @@ -25,6 +25,7 @@ */ #include +#include #include @@ -61,7 +62,10 @@ int drm_i2c_encoder_init(struct drm_device *dev, request_module("%s%s", I2C_MODULE_PREFIX, info->type); - client = i2c_new_device(adap, info); + if (info->of_node) + client = of_find_i2c_device_by_node(info->of_node); + else + client = i2c_new_device(adap, info); if (!client) { err = -ENOMEM; goto fail;