Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp282702ybm; Thu, 28 May 2020 02:37:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRHBAlKM66cTG9tAUx0YGpAM9LFikA8BO/JuqAjyIOOnmjoIaISvkzgxQ6Lcq+nQ7deMvX X-Received: by 2002:a17:906:c828:: with SMTP id dd8mr2276446ejb.550.1590658674248; Thu, 28 May 2020 02:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590658674; cv=none; d=google.com; s=arc-20160816; b=cIeFNriKrhghBcP0LRj4OIWnEB9TbxiZi6plQz1uJhBen0sS/cpeSk15BgHzLgJW+t 0a6oRoIN2jRTcukjX9rtAu5Bv70n22Kw+QjzT7WA3V2+sI0hV4mUWDVFHHfuha6muA8S vGsXL0xL4bnM+dcuotzJ22QI3nxVN9OzxaQEhPPdYy2US0m5OLbDTooNMyhlfOnOP4S5 nEdL/S5PceUCWEXR3ttGl7k9hPkk55ia3Muk34XHbWBzuhlA/brbsR0BhL6tNaoqX6q2 zM2cAo9o+qoaRIC2t+yrhK3ljD1wWXiJaKxAqHmyXKeO2eW+3iKdSe1wZM2D8b5rJH15 vRVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9WL7/OyeAbtK8LcQRvm4NpG/P0Oqx4X5pV/iB+Tb9PU=; b=0O3Dce8VWAmFNE0f2vrA8LsCzcwa2sUBVCa/2I77OPLqCyc1YjeswgHi29AEO7OCFU PLhnGvCaTmxglJCRe758NXLvGJEPkeRsUg8X6Cz+ahJQ5muIpMYtltiyier/2XqZx52Q g/tdcyohMJjADfQ8RAUeDVXUWF2n7TTg3Yk8agjJX2dIsa1MbqwMK/+n4bxpiThb5XtD Ub06MfU5zL5NMK4BuMSM/NnObcGVsMFFIC+6NCMzE6nUUWfJ9IfdmOZIx+rdpge4iw+N czUtjBBZx0LlKJa9mrtDF1/msFD55lfQaG9f17LQ9a5yRHRsu5o4Sceit8kueCjuNPO8 Xz9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si3438951ejk.122.2020.05.28.02.37.31; Thu, 28 May 2020 02:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387481AbgE1Jdn (ORCPT + 99 others); Thu, 28 May 2020 05:33:43 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:40596 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387424AbgE1Jdg (ORCPT ); Thu, 28 May 2020 05:33:36 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 6F1458030777; Thu, 28 May 2020 09:33:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RweMfMw3LjJm; Thu, 28 May 2020 12:33:33 +0300 (MSK) From: Serge Semin To: Jarkko Nikula , Wolfram Sang , Andy Shevchenko , Mika Westerberg CC: Serge Semin , Serge Semin , Alexey Malahov , Thomas Bogendoerfer , Rob Herring , , , , Subject: [PATCH v6 09/11] i2c: designware: Retrieve quirk flags as early as possible Date: Thu, 28 May 2020 12:33:19 +0300 Message-ID: <20200528093322.23553-10-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200528093322.23553-1-Sergey.Semin@baikalelectronics.ru> References: <20200528093322.23553-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some platforms might need to activate the driver quirks at a very early probe stage. For instance, Baikal-T1 System I2C doesn't need to map the registers space as ones belong to the system controller. Instead it will request the syscon regmap from the parental DT node. In order to be able to do so let's retrieve the model flags right after the DW I2C private data is created. While at it replace the or-assignment with just assignment operator since or-ing is redundant at this stage. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org --- Changelog v3: - This is a new patch, which has been created due to declining the glue-layer approach. Changelog v5: - Replace or-assignment with just assignment operator. --- drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index ca057aa9eac4..38657d821c72 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -124,6 +124,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) if (!dev) return -ENOMEM; + dev->flags = (uintptr_t)device_get_match_data(&pdev->dev); + dev->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dev->base)) return PTR_ERR(dev->base); @@ -146,8 +148,6 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) i2c_dw_acpi_adjust_bus_speed(&pdev->dev); - dev->flags |= (uintptr_t)device_get_match_data(&pdev->dev); - if (pdev->dev.of_node) dw_i2c_of_configure(pdev); -- 2.26.2