Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp208271lqc; Thu, 7 Mar 2024 15:11:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWuI1jmjKaRJwuqRT6J00ZBaMMi0ku24OsR3LvpqTH3pI4UoCqL278MR4xFTnf8UbFNvxaVOWdeMNp01pYidcNa6mH5t5ajgXwF+/cU+Q== X-Google-Smtp-Source: AGHT+IG0RInTvIxlpapzepDMb+wh+sja0S1kp/eNNSoJxiLr6HLRPKyKi3WpGoRriECUSRppvVGG X-Received: by 2002:a17:90a:ba12:b0:29b:5f8:1b4 with SMTP id s18-20020a17090aba1200b0029b05f801b4mr14535911pjr.49.1709853108316; Thu, 07 Mar 2024 15:11:48 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ev1-20020a17090aeac100b0029b82a6da5dsi2573752pjb.37.2024.03.07.15.11.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 15:11:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=WcEc9BR1; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-96355-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96355-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A0A8B21F34 for ; Thu, 7 Mar 2024 23:11:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FAB03EA93; Thu, 7 Mar 2024 23:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WcEc9BR1" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A33653D3A7; Thu, 7 Mar 2024 23:11:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709853071; cv=none; b=V8Eew/hi9Lf1AHFMTM6mw+bToXA/XLW7+F9KjrcJuVzdsKkTDacgqja9uJkNGfeCe2y5UvS14SOm2pafH+PzZSz4CETxbtSJTvObAYCW4yWn24te+yI7ZyMB6xKBkz4lele2P5gcQ9l0Ur2CRAIcOX90lRR/AnNmvARZYlKg8WQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709853071; c=relaxed/simple; bh=0DUfqVmStnhMkNmPgPMTVw3GNV1qSqaLIBiV7oc9xHM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iahFrma1Hg0jMzvp2nXrkcKCD1My8X1dPHzvIzf56Rjq4GZBYxxDhlI7oVQRdiidA5XP51mYzBrfdZayK/mnd3n6aIC1I7zbc+5s/W1zs3sODNQaWvq3Urits/557CB6hst2lLACWSRu0Yg8mvpXTqLL8NHk5vDEhrtgTzQhapo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WcEc9BR1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EBCBC433F1; Thu, 7 Mar 2024 23:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709853071; bh=0DUfqVmStnhMkNmPgPMTVw3GNV1qSqaLIBiV7oc9xHM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WcEc9BR1bo6SgxFcK0K30FLiey7n6MEc1dTlzCh1Qk0HE+4rlKKEEMvDTH4l4HznE DR/6VfHvCQ9e2nLF9zip7AGaP8/8iqez1NG19mnCMYRWuNuhQPKGmW5g9Roh3ZDiJ8 OIiFDO8K8jP/ghRhTcuAPbmDbgW6wj8VKsUISXQ61xGZ/vy2OQxUUlcNKaPVkejJ4N BOlZF9kqfemsZeJAnsE5iygncPyza8UgLtc3HDCCIyt3zwRk9kf2UBSSvxTcYnSg9w JwYR3GSCxCdMtj90cNYxvmtd/G3n+o4+tUlCfJL7gwI4Pm8nvUlHd35e+Nxbx5jJhQ EjBCi0xiaDErQ== Date: Fri, 8 Mar 2024 00:11:06 +0100 From: Andi Shyti To: =?utf-8?B?VGjDqW8=?= Lebrun Cc: Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Gregory Clement , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk Subject: Re: [PATCH v3 08/11] i2c: nomadik: support Mobileye EyeQ5 I2C controller Message-ID: References: <20240306-mbly-i2c-v3-0-605f866aa4ec@bootlin.com> <20240306-mbly-i2c-v3-8-605f866aa4ec@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240306-mbly-i2c-v3-8-605f866aa4ec@bootlin.com> Hi Theo, .. > +static inline u8 nmk_i2c_readb(const struct nmk_i2c_dev *priv, > + unsigned long reg) > +{ > + if (priv->has_32b_bus) > + return readl(priv->virtbase + reg); > + else > + return readb(priv->virtbase + reg); > +} you forgot to remove the else... not a problem, it's coherent with its writeb counterpart. .. > +static int nmk_i2c_eyeq5_probe(struct nmk_i2c_dev *priv) > +{ > + struct device *dev = &priv->adev->dev; > + struct device_node *np = dev->of_node; > + unsigned int mask, speed_mode; > + struct regmap *olb; > + unsigned int id; > + > + priv->has_32b_bus = true; > + > + olb = syscon_regmap_lookup_by_phandle_args(np, "mobileye,olb", 1, &id); > + if (IS_ERR(olb)) > + return PTR_ERR(olb); > + if (id >= ARRAY_SIZE(nmk_i2c_eyeq5_masks)) > + return -ENOENT; > + > + if (priv->clk_freq <= 400000) > + speed_mode = I2C_EYEQ5_SPEED_FAST; > + else if (priv->clk_freq <= 1000000) > + speed_mode = I2C_EYEQ5_SPEED_FAST_PLUS; > + else > + speed_mode = I2C_EYEQ5_SPEED_HIGH_SPEED; > + > + mask = nmk_i2c_eyeq5_masks[id]; > + regmap_update_bits(olb, NMK_I2C_EYEQ5_OLB_IOCR2, > + mask, speed_mode << __fls(mask)); > + > + return 0; > +} > + > static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) > { > int ret = 0; > @@ -1012,8 +1087,15 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) > > priv->vendor = vendor; > priv->adev = adev; > + priv->has_32b_bus = false; > nmk_i2c_of_probe(np, priv); > > + if (of_device_is_compatible(np, "mobileye,eyeq5-i2c")) { > + ret = nmk_i2c_eyeq5_probe(priv); > + if (ret) > + return dev_err_probe(dev, ret, "failed OLB lookup\n"); > + } > + Looks good! Reviewed-by: Andi Shyti Thanks, Andi