Received: by 10.223.185.116 with SMTP id b49csp3552518wrg; Tue, 6 Mar 2018 00:39:05 -0800 (PST) X-Google-Smtp-Source: AG47ELtyovixd0dJhntPJ1M+nvglNs4qdJRkoMU97GTUsndQnYLdkKYha8lmnEmsULo819nTgl2u X-Received: by 10.99.175.87 with SMTP id s23mr14513549pgo.328.1520325545571; Tue, 06 Mar 2018 00:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520325545; cv=none; d=google.com; s=arc-20160816; b=UaVWk+iBKeXxodH4xAF42qUsEfL/pAYLTfZS8bMxf9DQU0E1y/30BdGl+uyJ5nZTMl ZmgFtLPC0d+/EynUjFgQOWXnxwMTF8/GY5z8+V5L17zSB4y9kaBEOaiUgaC1XVpHkOc7 LpDcroCpb9O6846L0yQ56EFWhRa7XtoF/blkxgAQCs0RaUKxqIjf4aVIyxSPcSSpc9yE KnAu2jqeY0TrSvotdg22OAclVoDe919CiPBHZ/N8+wbLEVKQe+bKUyyqfKj0hC9f76bM RkLiHjbeqFLn53Xk33Eg5pASHSFAba3273A85pd097QZqITEvIq9Z8I5zJcOqwVOoER+ TgeA== 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=KjoFniQkF7Izflw9RrlB8Jan2TeT5tIug4JL/afK8ko=; b=vzukvhWeByuyFyT92yugC67ENB0epd4RP8UV6ylutI1xWuLFZWBOiPOX6EmWpjKLtS 8I4J7PhvYv01h2WCW8q126uscPSfB0UQpeH8qh2bk4T8C44/R+8Qd3OqlaXXvKHVG5H9 3OD62EyMibgZQahIhu3irvVEg9xp3pM/0PghgBzlzmVqBl5QgzcuHrjCSHZTvRJdRMqO Wm06yTCe1UoaPlutpnXq/9IPxDksJ6lcc5wTBLA2UtF/VCs7il1r3HGdVzcIRDDx8RQr MyxPTnAB4VFWTF/kWLX9PdfqCMydM6mEgutn3HVQAt3CTQ9urAvzE4G26SRkyOIwj2xP 23Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Ctl4R3vS; 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 g88si11689288pfk.65.2018.03.06.00.38.51; Tue, 06 Mar 2018 00:39:05 -0800 (PST) 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=Ctl4R3vS; 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 S1753243AbeCFIgw (ORCPT + 99 others); Tue, 6 Mar 2018 03:36:52 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36964 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752866AbeCFIgu (ORCPT ); Tue, 6 Mar 2018 03:36:50 -0500 Received: by mail-wm0-f68.google.com with SMTP id 139so20601661wmn.2; Tue, 06 Mar 2018 00:36:49 -0800 (PST) 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=KjoFniQkF7Izflw9RrlB8Jan2TeT5tIug4JL/afK8ko=; b=Ctl4R3vSzSlBnuVXRQUmzMCEjafNqu3XCjryB8wGRXOzacFM9TRU1rwNpeJa27kcGZ 7Uma2DQjjgsCLvUZpj44lE1Ji7vtxP1vEMxL0GTGCOLOSkhEeq2nJTmEXQXFNkTC4ajp u8a0B1xMXkM7Gp/FFrJ2DnMgtanVtA2bf6evHYmrjfx7RXl+Fs1Hzws6cOqWuxlpzvji 8iggcfsR2B6xX/2uINK45FLcSe5ip4M7pIrQ6Gm3D7/EO67PUYToOS9/lUhAADPrreyi pBNyfYKGW9zel+AQG+l4gG8v7VepSjwfWfG9X2t+Z8epC2OXB8RrPycfgg30HW+X/gh7 oLBg== 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=KjoFniQkF7Izflw9RrlB8Jan2TeT5tIug4JL/afK8ko=; b=QncX8pseTnDARl57djQgCAfOzA4/gQO3gkouWT9gIF9M+FU78d7bg7pqOEktrUPRfM K3HSsGnTD3sqd7douhrn1/h+SQvgEXcvvP5Hq77Vnlr3Ey84vU5sakq5xQAzv89PmzuP P7896GoCtHhJGXC6kym8qI5rQ/IIjSoz0KmQ9Gtjyf4sBWOfFQum0WqYSNof03zg1ZwD 0jU/qPte6C8CHpBI5m74FDz7ndi6dqBVJbwoldEs77J8CMkIg0uj3cJ13Y30iNAcJKHa 7aGzE3MiSieLaBv799qsFqBxA/zlhTrWpQcV/+mRX6GI8vurAKmqT2AOoaPAwZeg4A/z TsiQ== X-Gm-Message-State: AElRT7HR81fGi9xvqsM1CXy7RQ6xNOVEs80S6Z7F9uUDRO98qOTbI0e4 yBC7LdkFyD2siLsjMpFZtFY= X-Received: by 10.28.185.83 with SMTP id j80mr11196563wmf.69.1520325409007; Tue, 06 Mar 2018 00:36:49 -0800 (PST) Received: from wintermute (HSI-KBW-37-49-16-97.hsi14.kabel-badenwuerttemberg.de. [37.49.16.97]) by smtp.gmail.com with ESMTPSA id l22sm18293521wre.52.2018.03.06.00.36.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Mar 2018 00:36:48 -0800 (PST) From: Jan Glauber X-Google-Original-From: Jan Glauber Date: Tue, 6 Mar 2018 09:36:47 +0100 To: George Cherian Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, wsa@the-dreams.de, Kamlakant Patel Subject: Re: [PATCH 3/3] i2c: xlp9xx: Add support for SMBAlert Message-ID: <20180306083647.GA11729@wintermute> References: <1519737980-27997-1-git-send-email-george.cherian@cavium.com> <1519737980-27997-3-git-send-email-george.cherian@cavium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519737980-27997-3-git-send-email-george.cherian@cavium.com> 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 Tue, Feb 27, 2018 at 01:26:20PM +0000, 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 > --- > drivers/i2c/busses/i2c-xlp9xx.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c > index eb8913e..9462eab 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,21 @@ 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->alert_data.alert_edge_triggered = 0; Hi George, I think this is not needed anymore, see: 9b9f2b8bc2ac i2c: i2c-smbus: Use threaded irq for smbalert --Jan > + > + 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 +485,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) > + priv->alert_data.irq = 0; > > xlp9xx_i2c_get_frequency(pdev, priv); > xlp9xx_i2c_init(priv); > @@ -493,6 +515,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); > + > platform_set_drvdata(pdev, priv); > dev_dbg(&pdev->dev, "I2C bus:%d added\n", priv->adapter.nr); > > -- > 2.1.4