From patchwork Sun Mar 25 11:07:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 132387 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp2668830ljb; Sun, 25 Mar 2018 04:08:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELtpUgMJbGPnPf751+N9p2sc4AhDb9JQ5t1ncBtJXvTzsMlfS1tijRwsFJhFoY9lHvRkFaGR X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr28024631plb.198.1521976085298; Sun, 25 Mar 2018 04:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521976085; cv=none; d=google.com; s=arc-20160816; b=vQ89KUZHmNrvtFIyKHehd7b4h0l85LXL8PtC8QPv4ISBhjPi1ULrhrvNk66hd3Kk8K mSUYt2raGo/nIJ0KSUYu+GYlZaZ4TwCMUoXUQ454MMMxEAqRP7dqm0nt0hqdohq/fykG IU95JbwKefuLxPnocC6KTFJ7E3vUq9ru2DlTIu0BajspH9+7fzZHTJXf0gsEiVd9amdV F82PK7Wy6C34JUoAzTTW6kDfAWwTyuVo8dqjZEIUMFpwF3IxYTyoRHlOlh0i/qFCeM/Z 4YNBLryYw+dLMdM8l5IHW3rnC7zmHX94RPyI/8siZUnGw8Ii9Nr6r/9/uNJWmOsx30Fq 8jMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=4yCmq2uZM7F7mxhK95MsmBerLkpKNswzdGamiu10eR8=; b=m1CWOp1qwD43a4e6TxeC1E7MMiEbCYuWLHZGWfm3KG36+hLUNRPCQnek52w3ZMDQCT HqhByVfOvO7oboB0I7cmf/j7od8uuHq6yStJ41veR0Rfj5TcC+YmH8gLy0CHmVK3SdfK 6ksEMNOCvJnvsz3jfVnn3y+b6do/qtsBiKzJ4SAMxMQGGLKLqrjajM8y2pwGkHtCdZWJ K8zEcd2MmDI1ID0IZAjE+rhx4Wkg4TBFIzspZDs++4xFJWOpSCUr+3uPITaC9gAU+cle UFRetD+EajNpMTAs/5ZqKnrPMnDR+QivEkjquWwyqj/SCR5/dxkOpyHbN8b4PhmWE5WA jZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NajhIL9d; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si13805808pli.445.2018.03.25.04.08.05; Sun, 25 Mar 2018 04:08:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NajhIL9d; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbeCYLIE (ORCPT + 3 others); Sun, 25 Mar 2018 07:08:04 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36024 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751985AbeCYLID (ORCPT ); Sun, 25 Mar 2018 07:08:03 -0400 Received: by mail-wr0-f195.google.com with SMTP id d10so16113169wrf.3 for ; Sun, 25 Mar 2018 04:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=4yCmq2uZM7F7mxhK95MsmBerLkpKNswzdGamiu10eR8=; b=NajhIL9dOzNQAytmKYlLZv50rUIepi7BbOJh6Ixqwa9KCxOCU21fp+nxXfX+6jKLyg aEEQ4cneji5JBPC+qiQsYzJ8GyN4X/MEHaxwy762yy4dxYlCRiApxnw3+ERicTeot0LP jkPZPVkLDvvKaA+eEr81EFgsB3tg67SPH6DNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4yCmq2uZM7F7mxhK95MsmBerLkpKNswzdGamiu10eR8=; b=d6lolBYoK+oNNY+A735bsiPLWtltkNtKbehLHaZAlAXnbs58qNdEX/MP4Wf+RHuxi5 Da7TQBgBMcCyB//bUrNdNeQnyO3qAnBDT+bUIlrjkneL190dPX2a+Ju89HEcV1XdC4/g 7AZgYxhKNfifBLYNxwLt7aDMLanEy95DaG6C67l1rQzim8KDq8WXIjBl+kHhn2lXHu4B 74+fv1LUEWuFlEWA+VdaliBT3lESSi6vKADj2OLqV99lk58Xk4coMFBsmCApue3rMqEv TCIZPjATadez3VvLZZu4IkigrFwh37SgRwbKbvzuZ3lW7xTZJ93tdBfHV+xLmRZIlli5 eQ3A== X-Gm-Message-State: AElRT7GSNOxQPlSC3tA3S9M723nJm2EiHoCNRfOabfyeGyfUFw6DM3mb GS1Tz9cBGvqwF/fyVdBrPxI/qg== X-Received: by 10.223.190.140 with SMTP id i12mr14989798wrh.63.1521976082319; Sun, 25 Mar 2018 04:08:02 -0700 (PDT) Received: from localhost.localdomain ([160.105.205.136]) by smtp.gmail.com with ESMTPSA id w134sm14354298wmd.45.2018.03.25.04.08.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 04:08:01 -0700 (PDT) From: Ard Biesheuvel To: wsa@the-dreams.de Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jassisinghbrar@gmail.com, andy.shevchenko@gmail.com, Ard Biesheuvel Subject: [PATCH v6 0/3] add support for Socionext SynQuacer I2C controller Date: Sun, 25 Mar 2018 12:07:44 +0100 Message-Id: <20180325110747.8852-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Add a binding and a driver for the I2C IP found in the Socionext SynQuacer SoC, which is essentially a rebranded version of the Fujitsu F_I2C controller. v6: - use i2c_8bit_addr_from_msg() instead of open coding the address generation - switch to generic recovery using minimal helpers to drive the SDA/SCL lines directly - use reinit_completion() and move init_completion() to probe function - replace bus free detection at the end of a transfer with a simple udelay() for 2 clock periods - don't recover on every error - don't call synquacer_i2c_hw_init() from synquacer_i2c_hw_reset(), since it will be always called twice in that case - add patch to sanity check i2c_transfer() arguments in core code (#3) v5: - add Rob's ack to #1 - drop unnecessary 'platform_set_drvdata(pdev, NULL)' in remove path (#2) v4: - clarify binding that only a single interrupt specifier is expected (#1) - check return value of clk_prepare_enable() on probe path (#2) - add Andy's R-b to patch #2 v3: - incorporate more of Andy's review comments (#2), especially regarding the bus speed and clock source handling for ACPI - patch #1 unchanged. v2: - incorporate Andy's review comments (#2) - patch #1 unchanged. Ard Biesheuvel (3): dt-bindings: i2c: add binding for Socionext SynQuacer I2C i2c: add support for Socionext SynQuacer I2C controller i2c: add param sanity check to i2c_transfer() Documentation/devicetree/bindings/i2c/i2c-synquacer.txt | 29 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-synquacer.c | 739 ++++++++++++++++++++ drivers/i2c/i2c-core-base.c | 3 + 5 files changed, 782 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-synquacer.txt create mode 100644 drivers/i2c/busses/i2c-synquacer.c -- 2.15.1