From patchwork Tue Apr 3 19:11:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 132780 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4175432ljb; Tue, 3 Apr 2018 12:12:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+8wbZG0dqFhpCnlvmXW48ZdlqjQ1D1dTAWH2MUCKZ1d8bCq4gUlF4Q2WMDdEDBsfObiKat X-Received: by 2002:a17:902:8a93:: with SMTP id p19-v6mr15834132plo.256.1522782721325; Tue, 03 Apr 2018 12:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522782721; cv=none; d=google.com; s=arc-20160816; b=Te5t/onYpp87uzNC/2cowgmjXVPzEe64O5S7Bj14M87jnvmlCSk+9tS4OXulTwdt6Q iqq2nQG2/5wjAFuNaaJZiwa66gzSFS7pbcfktHMd2hkHCYb8q1STIJecXgNT5KoIy/ah c5frzsYm+6m2SxYrTp6jod2L0NrZgd/yNI8m/Z2XWvb669Itsz8slR/KYbPlNT4pw9SD WP6q2Kw4Xy7NOMNGhoMkDK5rWv6tFjh6BbRffYdMZ/gOQTIfzUP6gRXhGiLeaMwm7wxy okX9wv/lW1MZDcamKpQEEO2teXV/4/J7gd0RhQoLCFB5ENG4aTE+Rve3Fjwdh2u7ju07 zXdg== 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=AppP8z6dkWL5q72ZNDJk3yYKriiWXsDnQuku9G9y8qM=; b=MD9v8t/vw4aiL/7+pu2TSDBZrtI3A/nLcfks8aLyMxxV7cjnaSC6iX2gPcqkzZuLPb 4/1gd1aVvA93UOgUEZ6auQ4mTzy2lQWiGSuBKXZ+S7Ol+OyNi9ZOR7+OTJm6SUHieCO0 RVWJzYkNONxLVjtKXNrR1/+SrN8jZMVGuLJt3x3GjCk/qw8bcfJIZUc0He77l/GgVItR S+Elku/WOgIs6+orWDE+joSRk3IsZSrUQ04W1750Tfn1e0wO+Pl1ueym0UvwtAFlxLqk LyHcu5O5G3utj1VJWjiiKtCSk2mMeB9QSfW7Iy94XxyMw4kNUNUFSvL6XRppERSMBlmT 2bbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AQHqHecU; 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 s78si2646947pfa.374.2018.04.03.12.12.01; Tue, 03 Apr 2018 12:12:01 -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=AQHqHecU; 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 S1752881AbeDCTMA (ORCPT + 3 others); Tue, 3 Apr 2018 15:12:00 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52660 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752832AbeDCTL7 (ORCPT ); Tue, 3 Apr 2018 15:11:59 -0400 Received: by mail-wm0-f66.google.com with SMTP id g8so11877357wmd.2 for ; Tue, 03 Apr 2018 12:11:59 -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=AppP8z6dkWL5q72ZNDJk3yYKriiWXsDnQuku9G9y8qM=; b=AQHqHecUn4pAoAxyVGDpKV/K7MYjiMfZmS2U9u7POqiNiIDE5fpEAhF6g3DQ7fl7EI mwhg/k/pgXkbrKOwSruGxA5udFrEAPowNtDu/iB1oQyNHV5kcrZxfoPFrqcywAfJWaxC eEdvrdH4yJj7ECd/hnNBM2lGn0sR5FItgxZB0= 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=AppP8z6dkWL5q72ZNDJk3yYKriiWXsDnQuku9G9y8qM=; b=b6KdFkv4clsVLT1yxTNHWR+mHnCG8FAovwcj5lRNjmkuN4vrK+Bpl5jRnV6LAECJG5 p6V4O8oWNPckT6bAg2CEBb1nU39AyXzP5Ig/hGxxNjaHO/XR8Yn6nX08k59Jort1ljcW 1WGfl1MBa7zsK1G9YMEukJn5eddnp/A9MxC3uqm41NkDWKtL0Kpi/1kgbPMLAjj3s3N2 WcEac4yFqgQ5UUBtBtg4j21CGOe78V6fefW5yAitrDpUzi11rgGgo99PGBlfiT29EjqK 4JoryhgtJHKH5C58dsLASCrH1vyVlv64I4x+h6m7d3C6bL9PuZS4njQSrmHKZUOSGbYN yPbg== X-Gm-Message-State: ALQs6tB8Lc/YkwbXNSOD5n1hUBmyUxNcz8XAHWLvdsQfbEt0jipX7OFw h8ucR9ZrrwY5BBRHodwslfIUPw== X-Received: by 10.28.116.26 with SMTP id p26mr5504687wmc.102.1522782718565; Tue, 03 Apr 2018 12:11:58 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id y100sm25120682wmh.2.2018.04.03.12.11.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 12:11:57 -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 v7 0/4] add support for Socionext SynQuacer I2C controller Date: Tue, 3 Apr 2018 21:11:47 +0200 Message-Id: <20180403191151.14924-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. v7; - remove recovery and suspend/resume support for now - add myself as maintainer for this driver - use WARN_ON() in i2c_transfer() sanity check 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 (4): 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() MAINTAINERS: add Ard as Socionext SynQuacer I2C driver maintainer Documentation/devicetree/bindings/i2c/i2c-synquacer.txt | 29 + MAINTAINERS | 6 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-synquacer.c | 669 ++++++++++++++++++++ drivers/i2c/i2c-core-base.c | 3 + 6 files changed, 718 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-synquacer.txt create mode 100644 drivers/i2c/busses/i2c-synquacer.c -- 2.15.1