Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp1004868ybr; Sat, 23 May 2020 04:05:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4avRsgaXXl/g8kCbXx9G1cOskfx1+0qz1iLadE/XXOlgJfH/TOYG519vpc/fe6zjtrkxI X-Received: by 2002:a05:6402:14d3:: with SMTP id f19mr6353250edx.135.1590231913529; Sat, 23 May 2020 04:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590231913; cv=none; d=google.com; s=arc-20160816; b=XUSYnDUnD9hFyt3kn71FC91CefMK91jNyb5N2ZTDtYOMs/V6OHtvXQZA0dOIh/FWQA aF0LGY+sP48qMUyLI+NWGqZKMMbMdW8PJSHeNJf3jRIRQui4X0m3PXa/14MyrarxmePG gayXCuf6W6T0d2h8yCQai0YBmrRVMZh3AlKgsddrORBR14kFXJMNyeMksXw+oxSTofMC THZ5naDEEwTm0KbKPdh5v186xomUcuoFr8QZkXSW8fOuXwKNx/q6z+qKbUnRzWRE+GY1 Oq5V0zsbe/vQyIwxYvCXB/L7r9/iUVbeWl9Wu7uEIBiPLRQ8FM88idV6+1otPuQ5Ktac SKAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yOKe9gMXEddilkAnQ6MbAGg/3M9BtYv6xCPlzY8y7bI=; b=BDQ3gngaChL4UyZ0RQbVuLTeukGpFSZS8TRS82CyZYjHuPQsVwShDNCRGyOg50rrvM RLaFyufL7Lc8cToAqN4xNxeIImcZBrLJenB70JIj7Qm/e0ZksIJBk8ukZo4kTP03J9JI Y6ohNRLEJqjzdkFLcqwUr1Xf1MgZBjT0OP1AghK5xjmb8bLz7TbUAfSFCmJOfP5jgxpL 3vzRi4fKzB89Uhu08AzVqU1JWeqYhnhPktidCo4meFuSGrAtjxHBbEUQyRik1iNt/Bg1 1wCIIHDvkuL+khBqC3jD7qwvnZ9h4gsRTmbRJwPQwRASXRF69G/wVezkBCzmPhbcy8mE TSNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PvxGdi8J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si5747753edw.135.2020.05.23.04.04.36; Sat, 23 May 2020 04:05:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=PvxGdi8J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387753AbgEWLBp (ORCPT + 99 others); Sat, 23 May 2020 07:01:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:33976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbgEWLBo (ORCPT ); Sat, 23 May 2020 07:01:44 -0400 Received: from localhost (p5486c962.dip0.t-ipconnect.de [84.134.201.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5AA4D2070A; Sat, 23 May 2020 11:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590231704; bh=xemUji08Zmu27LB6PcMCt2apr23hpQFKF9p4eBeTcUs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PvxGdi8JW2GIxv1ABsPvTRT7aPsZr1ZUbmMFkyEtmN8PfosXq6gmoO2sa8qFQe7o0 39mzeGKp7wFGafKBDr+GrIOaPyYxL8PmCLhogdPcUpNa80rM57xQ+ty8+rxMhqoZkY NIAS5Rk4rTZVL7njuQMdcRMuKJwlz3v1bcDz8QxE= Date: Sat, 23 May 2020 13:01:40 +0200 From: Wolfram Sang To: Alain Volmat , Benjamin Tissoires Cc: robh+dt@kernel.org, mark.rutland@arm.com, pierre-yves.mordret@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, fabrice.gasnier@st.com Subject: Re: [PATCH 4/4] i2c: stm32f7: Add SMBus-specific protocols support Message-ID: <20200523110140.GD3459@ninjato> References: <1588657871-14747-1-git-send-email-alain.volmat@st.com> <1588657871-14747-5-git-send-email-alain.volmat@st.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="u65IjBhB3TIa72Vp" Content-Disposition: inline In-Reply-To: <1588657871-14747-5-git-send-email-alain.volmat@st.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --u65IjBhB3TIa72Vp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > +static int stm32f7_i2c_reg_client(struct i2c_client *client) > +{ > + struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(client->adapter); > + int ret; > + > + if (client->flags & I2C_CLIENT_HOST_NOTIFY) { > + /* Only enable on the first device registration */ > + if (atomic_inc_return(&i2c_dev->host_notify_cnt) == 1) { > + ret = stm32f7_i2c_enable_smbus_host(i2c_dev); > + if (ret) { > + dev_err(i2c_dev->dev, > + "failed to enable SMBus host notify (%d)\n", > + ret); > + return ret; > + } > + } > + } > + > + return 0; > +} So, as mentioned in the other review, I'd like to evaluate other possibilities for the above: - One option is to enable it globally in probe(). Then you lose the possibility to have a device at address 0x08. - Enable it in probe() only if there is a generic binding "host-notify". - Let the core scan for a device with HOST_NOTIFY when registering an adapter and then call back into the driver somehow? Other ideas? --u65IjBhB3TIa72Vp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl7JApQACgkQFA3kzBSg KbZPBg//Yu/cFAZDkasWicaLj/8KEo4knB3mYgq+/AGe8Sib9oPeQYo5UCBjjXhv svRUyxcoHxwRvRo5iG/0hl3SzrAZz1xoz46znwdyGfUm5pX1cDe4o4wYUnuQsuJL Kfg4+nQ/qLW75cOj1V1z9Tf7QGCWEhxkedMt+Up7xpDS06ZcwIb+Q4TE+Ziu/LYc MoDLi4rbjWVSZKWRKpBvAAXyVLZUoFDJuHGr39IafE9Y3JdixRglrjwDE6T4feQS V68mGqcWG1LBPtsyonN6PvPJq3bp9ZxhvhUioLUZCcoxmdSyT6qDewcOHczkwlnr ZZ4tX9QZjPLwEe6VaTeJqWWvOkrWPlsDOnUDiZq8WPowITVL7eRNvkBpkRpCRkdH hDNnOYtOgjVnGwkgM/S8aUEla8/LBTCWoFiGJ38yL7aNxXbEpE+uVQLsG1d2ci52 xfZZA0hm0GDxYKnigr11x3mIA8VdZLtQeaTw3EUZAsUWfKV/pfYRElsDZ/dul984 cSioEGynR6ndQJ+fEAaiRR2KWUaOUEaLCOco6aODIy/stIJnfSEQDk+cTsfBQV8v Ptp5MEwkOItxXftIwDLexRaob7cbre+jNa/Nsvl1EcJpqq2pN1dCXM40JVdqA5a7 J//X8FOfUW0pALR5BSvRFtV9QaqJ/MDXbeww81CCLO8Zo+uv6g4= =5Hj7 -----END PGP SIGNATURE----- --u65IjBhB3TIa72Vp--