From patchwork Mon Nov 19 20:18:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 10689397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B3B66C5 for ; Mon, 19 Nov 2018 20:18:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 873D427EE2 for ; Mon, 19 Nov 2018 20:18:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C682A57F; Mon, 19 Nov 2018 20:18:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D887429F26 for ; Mon, 19 Nov 2018 20:18:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730480AbeKTGnq (ORCPT ); Tue, 20 Nov 2018 01:43:46 -0500 Received: from antares.kleine-koenig.org ([94.130.110.236]:44102 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728844AbeKTGnq (ORCPT ); Tue, 20 Nov 2018 01:43:46 -0500 Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id C3B054899C9; Mon, 19 Nov 2018 21:18:29 +0100 (CET) From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown Cc: Marek Vasut , kernel@pengutronix.de, NXP Linux Team , linux-spi@vger.kernel.org Subject: [PATCH 0/5] spi: imx: Fix polarity switching for mx51-ecspi Date: Mon, 19 Nov 2018 21:18:14 +0100 Message-Id: <20181119201819.17240-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, this series fixes a problem found on an i.MX6 machine where on a single spi bus there are two spi devices with different clock polarities. The effect was that the polarity was adapted to the device to communicate with only after the chip select was asserted. The reason this happened is that the polarity was only configured as part of the spi core's .transfer_one callback which is called in spi_transfer_one_message() only after CS was asserted. The relevant patch (2) moves this initialisation to the .prepare_message callback. The first patch is a preparatory patch and the last three are cleanups I noticed on the way. Note that this patch set only fixes i.MX51 and later, the earlier i.MX SoCs are affected by the same problem though. There is delay in mx51_ecspi_prepare_transfer (the new name for mx51_ecspi_config) that fixes (or works around) a problem that smells a bit similar. Maybe this can be dropped with my changes? I didn't test this, but maybe Marek (on Cc:) can comment/test. Best regards Uwe Uwe Kleine-König (5): spi: imx: add a device specific prepare_message callback spi: imx: mx51-ecspi: Move some initialisation to prepare_message hook. spi: imx: style fixes spi: imx: rename config callback and add useful parameters spi: imx: drop useless member speed_hz from driver data struct drivers/spi/spi-imx.c | 144 +++++++++++++++++++++++++++++------------- 1 file changed, 99 insertions(+), 45 deletions(-)