Received: by 10.213.65.68 with SMTP id h4csp1448164imn; Mon, 19 Mar 2018 04:35:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELuUyt+kurA6DKqXKmSvX6ZYotXKvlZe1j1RnDk+ANLPhmakRYEqfE7aMtu61iOA1zGMkZ3V X-Received: by 2002:a17:902:6001:: with SMTP id r1-v6mr12149863plj.330.1521459332643; Mon, 19 Mar 2018 04:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521459332; cv=none; d=google.com; s=arc-20160816; b=0yOekddolkZqSUl3kYZvxRXUHKAqS3SDbw2b4LZogvrxOkVtLczGoVk/fdBrN0/ofO bbb7QBx7F0cPC4+eE0hFx3aR+PkiplaNBHWQToksmBhYDlpZzA4oONuBVbrRhuDMPJP3 pwZDhCN8eej1pJVxO4XL6NwJnlVeNMF0HCHblYiGev+ICK+FvVPuttPBTK4ucPnkCYXM RR1vXAFfi6fErrNayIa6K4ndGo6RIo2iFRjZ3CevE/4atChzKzayuXdvvLnKZeBjFZkO yNmpVZ6qGc+N4j304bQDh2XX9fh0m+n4Y7dm5vnW4wrbY54iuBmTZ5c8SapJjbgx4IEp PzoA== 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:date:from:dkim-signature:arc-authentication-results; bh=/1JjBKxsJmvFUYX3mOHmXy3MOUXF6l/Xj0JZ7+1bHFc=; b=AlfkHXbLR4+LugYcLgcLjm5TJ3k0tY19OTj6/3EwpaflJg7EfHJpxT9B5sC79gKoig 4hH5f7iQLPnePrG1BkJe7w7cH30mfVfdvw2WEz8Tk+NVc3zky9467v7etzIuHTtZegUh bsbxOVJJKw8J6O59ew5GHZY8b0HrCDzE4+8JgQQ7NmQcG3eXXuLurThLN6OXh2dLZVJJ EIyQmQGNT7YTZIBkiS5H8lALy/CWxp5cTVDqF4jwb/Hgt9/kzUW2HFwg/OgLdgSHwJFR P/rvoIetZGzRby4MwD/SoMro1eAoX96syaf3qDq8wPsvvDuubS6c2x82I6a1Nlo+tf12 GFCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lw1wkHup; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si9252048pgs.810.2018.03.19.04.35.18; Mon, 19 Mar 2018 04:35:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lw1wkHup; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932925AbeCSKul (ORCPT + 99 others); Mon, 19 Mar 2018 06:50:41 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39179 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755299AbeCSKuj (ORCPT ); Mon, 19 Mar 2018 06:50:39 -0400 Received: by mail-wm0-f67.google.com with SMTP id f125so6324790wme.4; Mon, 19 Mar 2018 03:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/1JjBKxsJmvFUYX3mOHmXy3MOUXF6l/Xj0JZ7+1bHFc=; b=lw1wkHuprjxHs4peBXl4aI1TuJmrUvsqcrl2P4S2mM/1o20/85N0EfTlqAG+tofoDa pxXg1IunPQdI7Exs6Ca74iLi7b7ZjfJfaHAcZZOqDbbj/SNZItgltdTsqt0+zz32vrvl OT7YUJfhIH5NhbxlZe0xdr1iazyEVlAorfTlGNSEWNyF56bSdOVpZMOoGBLc9eAHg8pU qojstXgQjEu/TtxwryNUML9SLEtRnb5L0fsNhPzHzbYhKucmXhn/io9ChMafeIfx0F/N yR9AKYZ4Utco+TRk9oWyvX+8W5Iu2F5FgbJQeKZMGs/GGIQgvUgRfbk04JlDvyr9YnLq GEaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/1JjBKxsJmvFUYX3mOHmXy3MOUXF6l/Xj0JZ7+1bHFc=; b=L4U0H0h+AL9WG/ZSGw2pNpGoq8R9xyDFMLqV107GVh2B5t3AY98dHCyYqCNTaPUSOd QW1513Fc2hVwVj5xllp9qqTEtH4fL/KjsqBEQ8gvxSN1Mwli4CTd5AusSHS03dU+y//7 7dYEVtWWuPW/MAGgE/+bqkjQZdkeB5hETQauoER1/zrOa3QKce20tGfOpQXVm3b3Rku3 u7pGRt02lY4d6IEwFieveQO8Jvfa/pjMx7fXzQw2DWwnOjP/cPhCHzT2onkL2VhAPd38 or7WQt4LkWkqUD2sljNpM4qISxsQz0/Amq1m5UhY75EMRloW4c1ztJOgzrAo3cBDyX4U ahWQ== X-Gm-Message-State: AElRT7Hz3j4TWWoJnix2Qs/e7SYdmxVqmJGTnBynSUckQVzU6f7t+cNj 7ekbML3QjYTl+WYvUZ7nuQOKVBB4 X-Received: by 10.28.230.79 with SMTP id d76mr8086244wmh.161.1521456638093; Mon, 19 Mar 2018 03:50:38 -0700 (PDT) Received: from wintermute (HSI-KBW-46-223-170-210.hsi.kabel-badenwuerttemberg.de. [46.223.170.210]) by smtp.gmail.com with ESMTPSA id l11sm11819217wrg.71.2018.03.19.03.50.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Mar 2018 03:50:37 -0700 (PDT) From: Jan Glauber X-Google-Original-From: Jan Glauber Date: Mon, 19 Mar 2018 11:50:35 +0100 To: Wolfram Sang Cc: George Cherian , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Kamlakant Patel Subject: Re: [PATCH v2] i2c: xlp9xx: Add support for SMBAlert Message-ID: <20180319105035.GA10534@wintermute> References: <1520347594-184146-1-git-send-email-george.cherian@cavium.com> <20180317210300.yyft3errf3opj2t3@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180317210300.yyft3errf3opj2t3@ninjato> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 17, 2018 at 10:03:00PM +0100, Wolfram Sang wrote: > On Tue, Mar 06, 2018 at 06:46:34AM -0800, George Cherian wrote: > > Add support for SMBus alert mechanism to i2c-xlp9xx driver. > > The second interrupt is parsed to use for SMBus alert. > > The first interrupt is the i2c controller main interrupt. > > > > Signed-off-by: Kamlakant Patel > > Signed-off-by: George Cherian > > Are the previous reviewers happy now? Reviewed-by: Jan Glauber > > --- > > drivers/i2c/busses/i2c-xlp9xx.c | 24 ++++++++++++++++++++++++ > > 1 file changed, 24 insertions(+) > > > > diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c > > index eb8913e..d5cadb6 100644 > > --- a/drivers/i2c/busses/i2c-xlp9xx.c > > +++ b/drivers/i2c/busses/i2c-xlp9xx.c > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -84,6 +85,8 @@ struct xlp9xx_i2c_dev { > > struct device *dev; > > struct i2c_adapter adapter; > > struct completion msg_complete; > > + struct i2c_smbus_alert_setup alert_data; > > + struct i2c_client *ara; > > int irq; > > bool msg_read; > > bool len_recv; > > @@ -447,6 +450,19 @@ static int xlp9xx_i2c_get_frequency(struct platform_device *pdev, > > return 0; > > } > > > > +static int xlp9xx_i2c_smbus_setup(struct xlp9xx_i2c_dev *priv, > > + struct platform_device *pdev) > > +{ > > + if (!priv->alert_data.irq) > > + return -EINVAL; > > + > > + priv->ara = i2c_setup_smbus_alert(&priv->adapter, &priv->alert_data); > > + if (!priv->ara) > > + return -ENODEV; > > + > > + return 0; > > +} > > + > > static int xlp9xx_i2c_probe(struct platform_device *pdev) > > { > > struct xlp9xx_i2c_dev *priv; > > @@ -467,6 +483,10 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev) > > dev_err(&pdev->dev, "invalid irq!\n"); > > return priv->irq; > > } > > + /* SMBAlert irq */ > > + priv->alert_data.irq = platform_get_irq(pdev, 1); > > + if (priv->alert_data.irq <= 0) > > '< 0' should do, or? > > > + priv->alert_data.irq = 0; > > > > xlp9xx_i2c_get_frequency(pdev, priv); > > xlp9xx_i2c_init(priv); > > @@ -493,6 +513,10 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev) > > if (err) > > return err; > > > > + err = xlp9xx_i2c_smbus_setup(priv, pdev); > > + if (err) > > + dev_info(&pdev->dev, "No active SMBus alert %d\n", err); > > + > > Do you really want to print this info every time SMBus alert is not > used? Is it common on this platform We do the same thing in the ThunderX driver and thought it is useful to have the info print. --Jan