Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp496235imm; Wed, 20 Jun 2018 01:39:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKSgo0GdROmWJ7YN+AuxkOigdX1J37kUsrNpFveu/xWo233LPf1Ia726Pkz9x+d/Kk74OyG X-Received: by 2002:a63:9246:: with SMTP id s6-v6mr930128pgn.35.1529483977166; Wed, 20 Jun 2018 01:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529483977; cv=none; d=google.com; s=arc-20160816; b=eF8MT0SYxWdaehIr4zR4+UaHNUWGhj6C2fNtNOXPvn+WhB4NJktOBJoaXM42jEhocX 7CtDPv3CjLSwZGqhpI34L4rYFSJGva1BpWmwo1VTsk+WILU89JgwKv9tJd8Dqq2IO7zp m5Tkmt1dmwe7rv5oNOdyefvbQkfd2evmdpLwTPeCgcLeOtoKt7OKvFB1P07w46ronEGy fSf8E5tTKwqmDRZcwyYcVii8agZl5PPGNKkEFb556Gf/tT7RvNs/n6BewcwttVix0YD3 IkhQ4GqhJb0f8y1ShG5p3zkq4wPhUmFa5H+wAZCkQVvjku72aaVDs5d9HfaWFPv6o4kN wlmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=T9Bbom5AxDXAKMDWUsMhIH1DpC0pCiwXcclpItONub4=; b=iSlJiKyvHTBk5gGSgzImrwfYz+FXuyFJaHC14IJT70hhTlhHPCRBgCw52qFPUFDDYO JYDuWFac0AddWluhRCuRyTm47MICu3UA/WUaAA6nVXV81wusbgfBSoVu9sJma1I32XfV NpUCEZ6GYMTpj8kU5kltvXsSS0Yz39IpIaJhsWPRP4VyizWpWaJCnwtiS646eZv9/4LA Fft87rSEdQTFU4lFJHeU/htp7Ow969yZFcZKnVV5cBcJQ3UdSdVEEm41TF3lQUvssEDJ PoJS2EgRLrcoqM2PilEX2VhL2PyD6wN/XT3eq6qgPe2Dlu8psyMj3G4fVN0XjUvv4vgz /0yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=iTqgOS99; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24-v6si1585577pgn.509.2018.06.20.01.39.23; Wed, 20 Jun 2018 01:39:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=iTqgOS99; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932465AbeFTIh2 (ORCPT + 99 others); Wed, 20 Jun 2018 04:37:28 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38252 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932314AbeFTIhZ (ORCPT ); Wed, 20 Jun 2018 04:37:25 -0400 Received: by mail-lf0-f66.google.com with SMTP id i83-v6so3661404lfh.5; Wed, 20 Jun 2018 01:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T9Bbom5AxDXAKMDWUsMhIH1DpC0pCiwXcclpItONub4=; b=iTqgOS99gx18FQ/b+2C5TbdxRVj6b0yZowv16DTiu6BtN91yqQBpNzHRUNWqfRKL/k 0f0gn5xerm3lbafwIz/fuGz4fg/53jP0eHMTRgrfzGAv9eHWNO7TjaDWltxsnj4NX72P F+1fxb4YPINi9wTKv22a53GXi4ySFvxJUK77Zurw4g5/ypuvV/+2CNBHw9YMF1Klo0tD iUpAgEoHg0h0UKNTH1HshtMQ+a/5V03Ql7bhsY5vD5BIhVYVLIeRG0KOPDtBPe1bj3vi fm6iD0reHq7QIjv6kgcrrRjztxreu7wMc20YqifSjsf5Ca7nbwm9Degsg6el3jKyCI4n eKCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=T9Bbom5AxDXAKMDWUsMhIH1DpC0pCiwXcclpItONub4=; b=GXtJlsTaWT1JAOw2prrsuLxgLf7Ef8txknd8hkb8WKxj2m5ySmEm4EnWtbeP0n4EF5 CRQSQABQaRNJLGjmu6c3hgDJnZqm9DbQe2TjjEJ8Rqkcigexdy8ZPamvXd7oN4vqy88z tcTLRyQ/RlSLFfiH8FTH3uZnGehQiKtBEhGycD+iiqVIPsn5f28YGseIGa8f/YZyKA+O iyiTHCy2YfaCnuEl4eTk3nFQeAl98tjm2XcAZ4t3rrzm2felWT5AoW/OvNhZXJfZMDkX 4a8gTDhGek7xtC+0gSI7W95cDT71rLawmP2ynGLQANXPlvVN3pFg3thaqeV6fV7C+cII FeTg== X-Gm-Message-State: APt69E05fGgBOzKZ5GUz5I3LYLFyB2IKvi4+ZqLbPc7kArOMYl7okI1I Z1CT81rntGjoH2CKh6LkOPG8Oxfr X-Received: by 2002:a2e:4189:: with SMTP id d9-v6mr12846354ljf.36.1529480105752; Wed, 20 Jun 2018 00:35:05 -0700 (PDT) Received: from localhost (87-57-30-174-static.dk.customer.tdc.net. [87.57.30.174]) by smtp.gmail.com with ESMTPSA id m186-v6sm286747lfe.16.2018.06.20.00.35.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 00:35:05 -0700 (PDT) From: Esben Haabendal To: Mark Brown , linux-spi@vger.kernel.org Cc: Kurt Kanzenbach , Angelo Dureghello , Nikita Yushchenko , Sanchayan Maity , Yuan Yao , linux-kernel@vger.kernel.org, Esben Haabendal , =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= Subject: [PATCH 09/12] spi: spi-fsl-dspi: Framesize control for XSPI mode Date: Wed, 20 Jun 2018 09:34:39 +0200 Message-Id: <20180620073442.20913-10-esben.haabendal@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620073442.20913-1-esben.haabendal@gmail.com> References: <20180620073442.20913-1-esben.haabendal@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Esben Haabendal Signed-off-by: Esben Haabendal Cc: Martin Hundebøll --- drivers/spi/spi-fsl-dspi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index 3e9dd645ee54..ba83ff4512c9 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -119,6 +119,9 @@ #define SPI_FRAME_BITS_16 SPI_CTAR_FMSZ(0xf) #define SPI_FRAME_BITS_8 SPI_CTAR_FMSZ(0x7) +#define SPI_FRAME_EBITS(bits) SPI_CTARE_FMSZE(((bits) - 1) >> 4) +#define SPI_FRAME_EBITS_MASK SPI_CTARE_FMSZE(1) + /* Register offsets for regmap_pushr */ #define PUSHR_CMD 0x0 #define PUSHR_TX 0x2 @@ -662,6 +665,10 @@ static int dspi_transfer_one_message(struct spi_master *master, regmap_write(dspi->regmap, SPI_CTAR(0), dspi->cur_chip->ctar_val | SPI_FRAME_BITS(transfer->bits_per_word)); + if (dspi->devtype_data->xspi_mode) + regmap_write(dspi->regmap, SPI_CTARE(0), + SPI_FRAME_EBITS(transfer->bits_per_word) + | SPI_CTARE_DTCP(1)); trans_mode = dspi->devtype_data->trans_mode; switch (trans_mode) { @@ -922,6 +929,9 @@ static void dspi_init(struct fsl_dspi *dspi) { regmap_write(dspi->regmap, SPI_MCR, SPI_MCR_MASTER | SPI_MCR_PCSIS); regmap_write(dspi->regmap, SPI_SR, SPI_SR_CLEAR); + if (dspi->devtype_data->xspi_mode) + regmap_write(dspi->regmap, SPI_CTARE(0), + SPI_CTARE_FMSZE(0) | SPI_CTARE_DTCP(1)); } static int dspi_probe(struct platform_device *pdev) -- 2.17.1