From patchwork Mon Jun 29 18:53:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 1319204 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.a=rsa-sha256 header.s=k1 header.b=nQ1EUsah; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49wfWW0XH4z9sVF for ; Tue, 30 Jun 2020 06:40:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733035AbgF2UkO (ORCPT ); Mon, 29 Jun 2020 16:40:14 -0400 Received: from www.zeus03.de ([194.117.254.33]:52750 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731720AbgF2UkH (ORCPT ); Mon, 29 Jun 2020 16:40:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=FpyLO74xYjwKVoBrUpqtoejScYA bwTvzYbQXG0AzIBU=; b=nQ1EUsahMFmEkwYyu5L8gzzK0xSmXQHQpDVLCkDqXoO v4t/EgmTCxUIckP1tzbNOvdWoLmZznuQMu95FjgmVhplDTnP3JFypGn0hzCODzfR c9INa5KqnlKywhP4lfOt2gtgpaYnsQxoCeoKdnuOdv65OwtYHSU3mCqB2zUpeh/M = Received: (qmail 2142400 invoked from network); 29 Jun 2020 20:53:24 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 29 Jun 2020 20:53:24 +0200 X-UD-Smtp-Session: l3s3148p1@sQ7Okj2pYLQgAwDPXwOPAD5GWjq5uCZs From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Alain Volmat , Wolfram Sang Subject: [PATCH RFC 0/1] i2c: add slave testunit driver Date: Mon, 29 Jun 2020 20:53:17 +0200 Message-Id: <20200629185318.23381-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Motivated by a series by Alain Volmat which implements SMBus Host Notify support as a slave backend[1], I wondered how I could actually test it. Then, I picked up my old idea of a "custom remote device" and implemented it as another slave backend. This is the first draft and it works quite well on my Renesas Lager board where I connected two I2C busses where both I2C controllers are master and slave. One slave is the testunit, one slave is the HostNotify listener. While I really like Alain's approach, there is still some more testing needed. So, I already release my testing environment, maybe other people are interested, too. This patch depends on a documentation update. Also, for Renesas R-Car SoCs, some fixes are needed. I suggest you simply pull this branch here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/slave-testunit As mentioned elsewhere, support for SMBus Alert and I2C_M_RECV_LEN are already planned. But I guess you can do much more. Ideas and comments welcome! Happy hacking, Wolfram [1] http://patchwork.ozlabs.org/project/linux-i2c/list/?series=185718&state=* Wolfram Sang (1): i2c: add slave testunit driver Documentation/i2c/slave-testunit-backend.rst | 48 ++++++ drivers/i2c/Kconfig | 8 + drivers/i2c/Makefile | 1 + drivers/i2c/i2c-slave-testunit.c | 146 +++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 Documentation/i2c/slave-testunit-backend.rst create mode 100644 drivers/i2c/i2c-slave-testunit.c