From patchwork Fri Mar 6 15:45:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 5956011 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A8F179F36A for ; Fri, 6 Mar 2015 15:45:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9021F20392 for ; Fri, 6 Mar 2015 15:45:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4F0220390 for ; Fri, 6 Mar 2015 15:45:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755235AbbCFPpX (ORCPT ); Fri, 6 Mar 2015 10:45:23 -0500 Received: from ns.mm-sol.com ([37.157.136.199]:50125 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbbCFPpW (ORCPT ); Fri, 6 Mar 2015 10:45:22 -0500 Received: from mms-0439.wifi.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 90065C8A6; Fri, 6 Mar 2015 17:45:19 +0200 (EET) From: "Ivan T. Ivanov" To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [RFC PATCH] spi: Ensure that CS line is in non-active state after setup Date: Fri, 6 Mar 2015 17:45:15 +0200 Message-Id: <1425656716-25363-1-git-send-email-iivanov@mm-sol.com> X-Mailer: git-send-email 1.9.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When drivers didn't provide setup() method, SPI core should ensure that CS line is driven in non-active state after spi_setup(). Signed-off-by: Ivan T. Ivanov --- drivers/spi/spi.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c64a3e5..bfba2d9 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1895,6 +1895,8 @@ int spi_setup(struct spi_device *spi) if (spi->master->setup) status = spi->master->setup(spi); + else + spi_set_cs(spi, false); dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n", (int) (spi->mode & (SPI_CPOL | SPI_CPHA)),