From patchwork Sun Apr 28 20:28:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 316 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BBB593F08F for ; Sun, 28 Apr 2019 22:29:11 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id j1sf6140597pff.1 for ; Sun, 28 Apr 2019 13:29:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483349; cv=pass; d=google.com; s=arc-20160816; b=sMx1f9vvhgIpPqF2mXVMKB9qjiGIAsT4ssfdNCM+FogtgqNkrj6EJFp2pPtkbuvx15 mhi4HM37pvYMpmYV79Nr05PzGZB1g0U4F59uvu4JgWXJ5wVNL8zvpR/6ZgQIybmJBILN Vlt1vWX7ruMzSy5xKm5TsQrc3G+Br4vkhA94vGG351gqDmMIveI8ul7re3XprBXzs5Hc I1xsY68niTHy1LAlVLx9iid3pTJyo6J2xa33qmL+wL3/Qq9lRnw5l852YF64OFg/la3P 2s/QMeDsbD9DgI/RMKE0FYW09YUiwz0TYuFlsLdCsHGkcBEooomujAPGTxRtx9iPwykM oc+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dhvDHwyCu3xYbb2eN9uSrLsaLXEKB8tWfWRo87iVWPg=; b=nJJ9+gilYWTdkKvxGShi2UswA5Tz2ZqLAToDAYJy1KEBg7MJioPZ7QsWdV4gOkcPt0 cDIUQIU6JZIVvYGrR5a1wIzeeRMnob9Yl6DvuDnms/yX9O7jszi6iJLldkor36N0+jPd 0c4DQbUNgdED5gY4pnS3oqpfYz7CsZBH+yQUT4hME9HFG8BZrYbIXEuVrAuObQjRw1B6 UrYIQ+bM7eIIJ2czsLbMZ8cwl6pmvj9sDP3NheFdUIz4oiY/Hqk7ld8xUqCWCeUS5f36 RDLcqLesXuYEk6kMFvbXCISNqfuwm8BMPrZ3sYYuqGgFwVsPN+LpcIc4t7oc2JxaFvoo KEwQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X6Qf3DuC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=dhvDHwyCu3xYbb2eN9uSrLsaLXEKB8tWfWRo87iVWPg=; b=JnODKrfhZDj3zsjbt3SbvfVslhTznXhSnqUb75dR/f5pe4NNSCeQa1pVxFoTjHLAC0 s9ifnbMUmAf248bEt3f2kXcEy3IZbM9836FxHlO5fijJtvVoNglp2j0hAcQ+xo0Cip/H 2EZYgB81BKp0xNt1gB4Gw6K3J4Jz0nXjUCAKY= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=dhvDHwyCu3xYbb2eN9uSrLsaLXEKB8tWfWRo87iVWPg=; b=Q1Reh8Yxr37ILXUc0daydtyYi/Xmba7R+hoZuYIVMyaYpWVIkStjY4qEQodNJnkRIn XF5TLAh4nBEKtwdLu+C6iYOK42dOSFLVlXgfcIsLPh7JmiwlMukUfoqaFxU42cdMGFDr kIy7BegUl9o122kLPO0WfgDQ1avJbhBmPTQMiuYWnKB3CJOcqdsTJDtPXrci+ARJgwwx A/+c2xh72lNH6TysiaHa9nRR71f5l7e9MrbyTLJEkDWPrf9n6ZXvmGKgJUQR8OqJeBFg po17zfvDls3gvI8NDDBbwYQttA6mC/kVeAx97q5FFa7xlUDGY+Jta00vYXHmRx/XeF1+ sP2w== X-Gm-Message-State: APjAAAUAMDmB4/+gqz4ic/R3/sE8830WyLhqsnALO5fj/4v1PabG0PQl ITkqaLEVTP41JajT4HTl5Zqq5ChK X-Google-Smtp-Source: APXvYqxJ9nYU7QVpDXyLsBxfOzrrz+LwN1rLWfCQEq7PFORgHH0XGO+7AFeiPpQwYLLLAxalGTBRhA== X-Received: by 2002:a63:c601:: with SMTP id w1mr6044761pgg.190.1556483349679; Sun, 28 Apr 2019 13:29:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b70c:: with SMTP id d12ls8394750pls.0.gmail; Sun, 28 Apr 2019 13:29:09 -0700 (PDT) X-Received: by 2002:a17:902:9693:: with SMTP id n19mr49822590plp.92.1556483349290; Sun, 28 Apr 2019 13:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483349; cv=none; d=google.com; s=arc-20160816; b=zDbcuHHL8Lbr4TCqNgVa/XxCXyBAfUzdjFg5Vd2CMZLQGPanLQP334ggwQozWqRyYK clurgTmnN+LzfNM+LAjpKOjpuCadGtqup5dFsuvKTecfomGZ8P7BK8ySRC4eFfN9zWGJ hycMM604r711BzPDgPdodXG94yp58nMZ8bqrMxE1k4/8lzNbdstbMtxZS/jH3C6E53PL kC5fLigZwZQulf9Lt511vUQyiTgEy9TTHMTTbuTJTE2j9LVhieTvLo11PW2QpOWhbBL7 /Ymrz+qxZXqqcH18ByJ+j1/MzZpUCXdO5DExFAW4+V1fh9mTQOZAHqPBQDtpY70yYHuq FwoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=XFnoE+OQs19b63FjEbv4Y2p2pUKJN+c47WNEYs4N3ls=; b=dsHX+KlDlnr7l5wvon+JcgbXr+NtTAOe5W9kCcM6w+cv+ZcmTVVUMiqx9kopSbJAve ZfApe/EZv7GjbLRpurtxs6G3Ri1aAjs7a+A5prsBaEfodsgksji7mBW+k/H2XHIQ2LLd PUHnpHmZkqtbxGXotolpqJpXOu6JWu6728QDXDpfjJGyhiucNowsErAk/Ws09BFw4TWW 8XQYq0jbFUFKhRLrsoZfsX3vqac33D421ByafN/0/OOYz+fdz9wksgNvxcqXLDbVb7Mj dZmTrFXoU550rKrdA0085KPHhIm7/1qv81XhZdG3doZI3soUHdxMgFhIvqtl9eXkTwsK PWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X6Qf3DuC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x6sor6763196pgp.20.2019.04.28.13.29.08 for (Google Transport Security); Sun, 28 Apr 2019 13:29:08 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:6842:: with SMTP id d63mr55716104pgc.49.1556483347895; Sun, 28 Apr 2019 13:29:07 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:07 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 01/19] spi: mpc8xxx: Use short type names Date: Mon, 29 Apr 2019 01:58:36 +0530 Message-Id: <20190428202854.8590-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X6Qf3DuC; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six The function signatures in the driver are quite long as is. Use short type names (uint etc.) to make them more readable. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 8d6d86d2b0..0c77f95159 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -20,8 +20,7 @@ #define SPI_TIMEOUT 1000 -struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, - unsigned int max_hz, unsigned int mode) +struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode) { struct spi_slave *slave; @@ -68,17 +67,16 @@ int spi_claim_bus(struct spi_slave *slave) void spi_release_bus(struct spi_slave *slave) { - } -int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, - void *din, unsigned long flags) +int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, + ulong flags) { volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi; - unsigned int tmpdout, tmpdin, event; + uint tmpdout, tmpdin, event; int numBlks = DIV_ROUND_UP(bitlen, 32); int tm, isRead = 0; - unsigned char charSize = 32; + uchar charSize = 32; debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n", slave->bus, slave->cs, *(uint *) dout, *(uint *) din, bitlen); From patchwork Sun Apr 28 20:28:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 318 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id DE27D3F9B9 for ; Sun, 28 Apr 2019 22:29:12 +0200 (CEST) Received: by mail-pl1-f197.google.com with SMTP id a5sf4682473plh.14 for ; Sun, 28 Apr 2019 13:29:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483351; cv=pass; d=google.com; s=arc-20160816; b=ghqkfp0RN5Su0VzpSH3bOFbd6ENNJpORfD95QZ2oU1F27ctUzcRI/9mEppalkgvfc6 DW65zP5C3vRu7pyIRkIx3tWrofv8zBG8cCCDmY8WItp50R6WhaZOdNcieR6CpyzBMSPS qDRv2IvfOCcNZKYy+J6yZDpEs5daByHGhJQ7ADu104I8GHAUkVPdWbPWJulW4iGYSsvJ WussQu0WJ34riAElwnP+IPKVcTwI2gjif6K1oluQFpUyq3Z0QvGvjMhlHFVqLFw8DLOB 9rf1iQ2pIAQx/wAgC2f2mXlS1vc1p9kuSlOhqVjYVDH+lxPQxkFxH4JuAAVCL4wtNZqX DpeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ROu0mjxE9+Gg6OmSiij57o/0e5C4lXheY7IrKUHYkaY=; b=aCiwjuc2XR+MNr4CgaUTG3MqwvevA5oS2p0t29gb2VJByGHmD27Grcta97xY+y484b ADijXOd0BgJbm/TSspO9LKJ8K66ut7d1pgOaz9wMdsZ3jNbmnk8xwyiZsU7VeupqWLU2 iFh8GC2s6Ru4Bh2aLsah2SWdH8n3vQjfNKW1viGtEY8psGtlxiB4tUHginPr4DvAkG7C bMIhJeq95pckWcJHjklUDh28dg6qanoTkHoGcfoqfVfhDKJmRVRWgs+fmh2CaMELCbE6 0VlQE0zDHqV2aWsHZ5hnWnnUi4PMwo3CQdan5j+qhMq1jBcyuDsSvp7r5A9TDEvF8vC+ LHYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JUJ3dskP; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ROu0mjxE9+Gg6OmSiij57o/0e5C4lXheY7IrKUHYkaY=; b=O36q1FpkL5YcJ1H35mVlj/PKhN+Z72qwF1NmL44AEdTRdzuBlutvssAmYAChWHEf70 +A+Lh6BKPc46PPgto4RIkFh/yUneFboSrLRuzZLTlWLG7KLYStjjY+4bYUqwLk3A5PmB h3DOS3k4+zMO/YnXd/MYaZje9ZG2mYLFTC2nU= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=ROu0mjxE9+Gg6OmSiij57o/0e5C4lXheY7IrKUHYkaY=; b=ZEiLINWETHU70cveaAryF3YvguG09A4VKwvclJ8k3p465iGfGJLjWiwJ4uuzf53Rg/ UOC5wpyqL7MG8fG2df+vG7IyrgyJ12bWdl4T6ERn/cHKrIO/+zXpzFb671qQCDCrLwbS aodh0WVdL2fpstmSTKJ5pDmOpjCQ5OQSMsEo8K+dWdrk8c62Mj4VhYvCBZcCQFgvKzPN bRFHl2kvN2GNusUKrYjEoFQNybG/RPdtvQMrIK8jeEk0dhuWsovMcYwZLF/zma/X7drS ZSGUq63DggNgML0hCKeUEDn22d8HXF12cxZhj9EBy9BIcFYeqAkFa2PJ/m/znY4ugN2E nXCw== X-Gm-Message-State: APjAAAXQrXx9VBNp0az2xGy3oLDrfBC6k0cfrXSHkvWZy7okHZSMB+UK 5QSRSsrZlR4yOpbrh92lipoDWSGF X-Google-Smtp-Source: APXvYqyq+436/YeLroFyMuYiM69o1yKWtiD2T1IIEc35GZCiEN49qDiqYauPmZYwIKYKE5nkYMBjYA== X-Received: by 2002:a17:902:a706:: with SMTP id w6mr58052886plq.91.1556483351380; Sun, 28 Apr 2019 13:29:11 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:6085:: with SMTP id u127ls362989pfb.9.gmail; Sun, 28 Apr 2019 13:29:11 -0700 (PDT) X-Received: by 2002:a63:ef46:: with SMTP id c6mr39208085pgk.392.1556483350992; Sun, 28 Apr 2019 13:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483350; cv=none; d=google.com; s=arc-20160816; b=xg4XyEfl/OmOrDwZcFPxtGgVpaz9I3t1HqigADeBDuo4M+oS3uqSEvRlHuMoLcjkc+ gRCBVShoNSfnzVJ+c9pd3N9MJQiRisl7wR/izr3kOQYe4cR06mo37kzmvqdpSEDARzAs /roW9ynfVA/Ru3XPEwI7VAX2UDhHNzXBD7xRICm06FX7D3ratRVNLZm1zOKTHVTCgay0 h2acIUev5AgK5vNjM3ekkjmNY+OFZgYDBV3sU6hmMc1r98NkJpUhKibtJs3H2/89n1f7 sqKDIROPW0KM5LY0eXbCbGzU1HSNLENM5euI015zVmm3uJrDcOb3RKuDUyDmaPvqe9R4 d0og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=EhfwlnJ+VTp2k1DHa3nsNWfNJy1Zc5vNptQUuQyKYbM=; b=e6kKHtAw6wgwZGGrQYacWc0mA+vT80xia44LvaHxzsxO3IVUS1+vPqC5FlGnOhcEBG E7fCR+JoRO40lpMBooRkxeGed3jLpHRtf1qfWa3Y/9tDuM+e3lLT11kon69i20pYwBXR 5VCirpWS0ovrFpuYLWOwv+lcaAPIyrJlVo5ms30pebQcWsbLHLuc0Ga0ybJRVWXx0WGJ xNMc6ufg/kOx/ygeHAIKeRhXsp6aBPDE1F5/howdoaXCaVgESR/Rty3ch9Fl28mnFKFv sgeojg4XjePrVuYCdUdE6O++eO6w0+PMzHeoU+0wMxo7IwisJS7IRdmXCHGe+/PLpAEC tUdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JUJ3dskP; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k12sor35217722pfo.70.2019.04.28.13.29.10 for (Google Transport Security); Sun, 28 Apr 2019 13:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:4852:: with SMTP id v79mr59361221pfa.72.1556483350660; Sun, 28 Apr 2019 13:29:10 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:09 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 02/19] spi: mpc8xxx: Fix comments Date: Mon, 29 Apr 2019 01:58:37 +0530 Message-Id: <20190428202854.8590-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JUJ3dskP; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six There are some comments on the same line as the code they document. Put comments above the code lines they document, so the line length is not unnecessarily increased. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 0c77f95159..3016cfe2ca 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -53,11 +53,14 @@ void spi_init(void) * some registers */ spi->mode = SPI_MODE_REV | SPI_MODE_MS | SPI_MODE_EN; - spi->mode = (spi->mode & 0xfff0ffff) | BIT(16); /* Use SYSCLK / 8 - (16.67MHz typ.) */ - spi->event = 0xffffffff; /* Clear all SPI events */ - spi->mask = 0x00000000; /* Mask all SPI interrupts */ - spi->com = 0; /* LST bit doesn't do anything, so disregard */ + /* Use SYSCLK / 8 (16.67MHz typ.) */ + spi->mode = (spi->mode & 0xfff0ffff) | BIT(16); + /* Clear all SPI events */ + spi->event = 0xffffffff; + /* Mask all SPI interrupts */ + spi->mask = 0x00000000; + /* LST bit doesn't do anything, so disregard */ + spi->com = 0; } int spi_claim_bus(struct spi_slave *slave) @@ -84,9 +87,10 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, if (flags & SPI_XFER_BEGIN) spi_cs_activate(slave); - spi->event = 0xffffffff; /* Clear all SPI events */ + /* Clear all SPI events */ + spi->event = 0xffffffff; - /* handle data in 32-bit chunks */ + /* Handle data in 32-bit chunks */ while (numBlks--) { tmpdout = 0; charSize = (bitlen >= 32 ? 32 : bitlen); @@ -120,7 +124,9 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, spi->mode |= SPI_MODE_EN; - spi->tx = tmpdout; /* Write the data out */ + /* Write the data out */ + spi->tx = tmpdout; + debug("*** spi_xfer: ... %08x written\n", tmpdout); /* From patchwork Sun Apr 28 20:28:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 319 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 099673F08F for ; Sun, 28 Apr 2019 22:29:15 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id f64sf6114481pfb.11 for ; Sun, 28 Apr 2019 13:29:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483353; cv=pass; d=google.com; s=arc-20160816; b=HEwJB38RQR1vSxx1EDb/5VPVAjWoAZR4ThfC45SigJQJSKnyb4Id9pHF/nHX1ofMZ4 pVvi/yb6myKkIydmRrSFAR3rEpq7HCbhKfdBh60Mlk2pyq21jd+KKYem9jZgKS9w+Hvn Hbu34UA12Yy6TTPeq2PPAFO4nRQfirpqqbjcCM+VZtN/syLpq2qePFHqfW8FAXP638rq eabxWOJj3Li9z0Oy4H4uLT3s5BJEK3T3t3l13lNzpcK+X6xLIHQHvoIZZkGcwwzZE7a9 5b91nCy2DH27g15ol5eBswnXKFTrMtgvHQzjYSB64QeumjWD0VpqoUYHasY3XFABCLiC AG8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=f9CoABwT+3GcekCCxW0upEXyprX3mM7YuG7c6GHi1+o=; b=MXkVxYjYu4JP8Z8mX9yfkjpvgLSmLssegH4P36C6IvOLMiuJ6BJ22LYG+WdLnfqdcQ RGeYyKLHBtm7dzU8tlx94WwlE5Cmu94ybJLfVusYLSsaMLjbSABfUQvOtrZfmRUJ3F/s McLbs3g7FigfsRrdu1fwhOMZhO+hr3Nuvcz0c0MJgBSMpcUaPOpAgKZBPHtKFyQ9nebe 2USAKsa897rzCcURqFlbrv6ZCE5T6bt2STNSugMg0rDYC8tn/jiVQfRF1Bc5mWkqR4D0 iLl4uGE8lQJfNvx+XxTktECOs4mSlMIeUqQmq8hFUXaR8PuqjN2Nm7pDB4bTmHFgdc2H qy4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="N4/zEtFH"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=f9CoABwT+3GcekCCxW0upEXyprX3mM7YuG7c6GHi1+o=; b=nQrEroTKgNGpZ9SxAbsp33rqaR2yyTKIja7mpMWklCvWOf3luNnY/nXKGRUwGBvWZX 8sYzvZnPIOT1QYCde2b1fNOeAfA8+K0x45labT2ikd8U96qruikoLHphfKTrvKSgGoU2 XzWE5PnFN/R7s3iZrYjmBYJYtKcMS9HgTM/Uw= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=f9CoABwT+3GcekCCxW0upEXyprX3mM7YuG7c6GHi1+o=; b=sBVdIegPh3V0XGYZwGTuAUe0ZycWdpC3nriBwwrEdXVH10eMzhqISiKR35JbWyRuqi 6CF02dtYkWZPXJG3PwfGEaFg1oN1VIVIo2xwPJq5lL1IO/AeCq5viovme63p4b/luVRT eIWinFEDktKHUk8QtMBV0/E0V2y2hVmBSoBBoBMygOS7sBbSSOnTT32T73LXRl9qAzYb /CtLDTUBpgWs6r3olCYPXVoZBbEN10vgZ2kJ6Atd6CX8jfH1+BPVScUCakhmqAgTrhGA HPeAAUFm+Un8rCD1w7L/bFZxbQ8ionF9jCLoYcZrC9NoRGLaG6E0Zzfgbjddqt5iwcpp oh6g== X-Gm-Message-State: APjAAAXW927xgSHrlNObfULm0RSSgSvC66k0ZafQkmmCG/pk5WKz7Wf+ PxMlYWZrrv5LwgCrua3hVgDqqfl0 X-Google-Smtp-Source: APXvYqxtz2pi3pJqEXAVwG+R2/SSZZJbAIzTzwIwy57mPEhIjLeILOl1AR+LrV8Caft9YwYDXYgR5A== X-Received: by 2002:a17:902:4643:: with SMTP id o61mr13882pld.95.1556483353846; Sun, 28 Apr 2019 13:29:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:aa08:: with SMTP id be8ls8387238plb.14.gmail; Sun, 28 Apr 2019 13:29:13 -0700 (PDT) X-Received: by 2002:a17:902:9304:: with SMTP id bc4mr59105959plb.312.1556483353471; Sun, 28 Apr 2019 13:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483353; cv=none; d=google.com; s=arc-20160816; b=Rf8WhZT6TqaAtN1s2Bealnz6IWE1VOYOfSBvTYZG5/P65VrCfpuxnc+/L31fqihgvW KYRmJ9tO2TSTcijnawLnF+Uzw5eFTGH1HP1TzG2AR4uMU7+L5V/PibHT9eqr/PcM6m47 syjC4Jvgtb7nUNZ4s4WLKMZYxlIClmT5Caf3lSYZHNb1x5CyGk4cyH1KLEZ9GATWAy72 7H2G7is/Uya+MbGUpcmNBhTMiTvhC75RZ2KwHxkP1CpSOYlp5e/QkvH/bvmigQcQ7vul GzE6PqImlMG650Gb9kLQnKiq85bexVT4sexR/ecRdhle5G45TWWRCfMSYBiQqGcK6mz+ CpZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=TXnmJXWzQZbceoQ13rsAItoSdwmGHt2K3HR8Es2Fhzs=; b=uE2lmd7cNpcARDVhHuGJJ0y0XQn7V06zuZ4Z8UYqnGZUSfQutU+ZM3tFLCoVXfS8y7 rOjl6UThirzWcy1YUMrSU0A3mSpxZbfrn2O48xajBm5iARZ7M7dW51rNATRnkhxG97h2 j2UBnzN+gk34sJsiwQh5Tetph5k41dYfUTpcJ2b9cqD/A0Gs6hArwm+l7JaqWjex37J9 h7EeuPhIigypRqlSlA6/flO4ADFhXSA+eob0RwawMG0WdbJWY8+HyVAAiiaMbMBluhbA X/5HWzd6FnebZ1qamlvKx7SZndCeKmmNxHxFZZIbzgWzVOJAa4HDZa9HQCWhvjb03B2G fcWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="N4/zEtFH"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i73sor6723622pgd.68.2019.04.28.13.29.13 for (Google Transport Security); Sun, 28 Apr 2019 13:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:1654:: with SMTP id 20mr10034237pgw.166.1556483353171; Sun, 28 Apr 2019 13:29:13 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:12 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 03/19] spi: mpc8xxx: Rename camel-case variables Date: Mon, 29 Apr 2019 01:58:38 +0530 Message-Id: <20190428202854.8590-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="N4/zEtFH"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six There are three variables that have camel-case names, which is not the preferred naming style. Give those variables more compliant names instead. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 3016cfe2ca..0393765b6f 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -77,9 +77,9 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, { volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi; uint tmpdout, tmpdin, event; - int numBlks = DIV_ROUND_UP(bitlen, 32); - int tm, isRead = 0; - uchar charSize = 32; + int num_blks = DIV_ROUND_UP(bitlen, 32); + int tm, is_read = 0; + uchar char_size = 32; debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n", slave->bus, slave->cs, *(uint *) dout, *(uint *) din, bitlen); @@ -91,12 +91,12 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, spi->event = 0xffffffff; /* Handle data in 32-bit chunks */ - while (numBlks--) { + while (num_blks--) { tmpdout = 0; - charSize = (bitlen >= 32 ? 32 : bitlen); + char_size = (bitlen >= 32 ? 32 : bitlen); /* Shift data so it's msb-justified */ - tmpdout = *(u32 *) dout >> (32 - charSize); + tmpdout = *(u32 *) dout >> (32 - char_size); /* The LEN field of the SPMODE register is set as follows: * @@ -134,15 +134,15 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * or time out (1 second = 1000 ms) * The NE event must be read and cleared first */ - for (tm = 0, isRead = 0; tm < SPI_TIMEOUT; ++tm) { + for (tm = 0, is_read = 0; tm < SPI_TIMEOUT; ++tm) { event = spi->event; if (event & SPI_EV_NE) { tmpdin = spi->rx; spi->event |= SPI_EV_NE; - isRead = 1; + is_read = 1; - *(u32 *) din = (tmpdin << (32 - charSize)); - if (charSize == 32) { + *(u32 *) din = (tmpdin << (32 - char_size)); + if (char_size == 32) { /* Advance output buffer by 32 bits */ din += 4; } @@ -153,7 +153,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * in the future put an arbitrary delay after writing * the device. Arbitrary delays suck, though... */ - if (isRead && (event & SPI_EV_NF)) + if (is_read && (event & SPI_EV_NF)) break; } if (tm >= SPI_TIMEOUT) From patchwork Sun Apr 28 20:28:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 320 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 57F333F08F for ; Sun, 28 Apr 2019 22:29:17 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id u78sf6114028pfa.12 for ; Sun, 28 Apr 2019 13:29:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483356; cv=pass; d=google.com; s=arc-20160816; b=nPlkMwV/okiTlOLvm/JW/SsbMvH3AsQdb8DBuTX9tM/+jh21MznrQ2YPq8H7EOVzcy J1hDz/8g2Xun8sWhOkn0/AzFY9XsXNLuAZwhdUA9Y2rBp+ubOmEADXvQ1LwNhmbBTOgR VdgV/M5Qp+3/tZV8oU5PxInBLvlZaDq9H9VZ6kgEzsa92M+bIL+DI7TxXG+DmPnJKqUG w5GUQP0C6jvZjhnA7V4fleP9nIxLt6XuZchsBwkn+CDSJFDoxVcA45HSwQvHIXwxjVDc ll5EkcGD8vk20RxneV0dOHkfPz8h2SU+fuvx7xZ+esBYygpO9tncVA/eQfdmQ7eNUpwO j2/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Gazav4Co760v6etnwlwUaRleeVklRnN2r1Uz/+JPFtQ=; b=rewz4ut3Krn7eozNWT5Tc9OJR5clk45Py3SVlmg8iigqhGSybQ/rh8dpzOshfV5Jhi ghwOvxkw8wiVyrBYKPzuML4RH0GS8zRZnsIyzTJmzOyRTdTCuHVcZdhe5rrJnBw7oQwa BnsXis9t5TtVuqxCtjvG94+3VWg1UFZnboLIuu9Sq7QGtnIUUvPt+pLSJzg/6yiyo5lh QbLbKsWBmUHb62DfRadj3fUFFi5MjFh0wDzUAfYIF/Vnc9AKDeb6MIiRjLQth6W24YI+ ur3gpr8AKKYZ59XGtChsBSuiBM/gRQl9E9F0dK5J1FD9l5N+cu6tJLrgklrx1lEthZpM FdnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c2vBzZEh; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Gazav4Co760v6etnwlwUaRleeVklRnN2r1Uz/+JPFtQ=; b=dQsV1OoOUh4LdDzpCtPWip1HGsHm1KqKiRBbfoJ0BK3IaOSZU2IqOVq6cnrlBqBKNE IG8m2OGIKqwNjToT0D700utvaVgz6N6wFBMvJZM6I4yCZRxOGwdPBnK1BSey9fQS2S7l U1ufQ+k1/bmnrVJEMVMldzTIr20A5fN0xhS1E= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=Gazav4Co760v6etnwlwUaRleeVklRnN2r1Uz/+JPFtQ=; b=i1aOoG0ICOK4UelOEFYI85H9VQMhKmOC1Dr2CC9OjjtJ17m7+wFksN9L6RxCz1sRT/ Wm2bYnLx4DhtJNzaxzWAzMCUTfw3Vg2s6Y/II4yBL7IjWLcCbINpfpYEc8bsCMpasDqt 1u5oELUt3EvLZcjp7057JW62cy4vrN+4GgrmeJqv18jGKmRoAVL+48hvQ452RRCdwoe5 iFIp2/rwOUjowr4XNf75n1lr8pawEPBzxGM8/kujyLKsaa31NBH2iNBq1Elq+grCQXRT yr5PqNbR0CbehT0YxwlSditCj8Os0rLZarfMfN/7Qs3YWKsdmjm+Gh2pkKHwVcuz6aaq QSsQ== X-Gm-Message-State: APjAAAW9PZw/jXb2CsrW99IYkl4mQfRPlzB9YMPEijKq4N4IyC50ScBR hSGFV3dWfl1mThMR0DQr6PEdqLQ3 X-Google-Smtp-Source: APXvYqwpfDv3Yh5RcmCTV2K3wN1CCsX6amHOn+PI9Igdd7rESZ8bFDs+bjhXCkQDheelEzFjSmLLLg== X-Received: by 2002:a17:902:e58e:: with SMTP id cl14mr17358330plb.85.1556483356180; Sun, 28 Apr 2019 13:29:16 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:4104:: with SMTP id o4ls145102pfa.4.gmail; Sun, 28 Apr 2019 13:29:15 -0700 (PDT) X-Received: by 2002:a63:8f4b:: with SMTP id r11mr55574956pgn.271.1556483355811; Sun, 28 Apr 2019 13:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483355; cv=none; d=google.com; s=arc-20160816; b=KNSCzhJOg0NlXkK5s5iqjXw+FAIX5rSZKj9F97w6gu2MJWK92mQUxoFJoWUwQF4CI1 RkjXtNnfZWHGCEdjC1e2xqEpg32uxm0HWh+LCm0GJEnKrpFAQVapCJYBtXveHXiMMVvu 1K+EXr8+t2CcElmkVRCZ8MGGIBRQ1rRAvovb9wNEgOSYq2wfWHeWgJkpuCPoATvEVcwy Q9VkhKM94o3I5mImtMoPMyqtgtgGrwpmPzKtYf08MHalktSN0Q5+139DK+7zErltQRm2 awHT2GYWoSbcUnGC0xGKSi/Vu3kGdrdxFhV3/q95RKnOLptgYT0e4mfVG9ap0rVVXEl8 gASw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=3htuolda1tctbiIjFrQItpUVWObxyyaNpBTNv3Hd9MU=; b=qzwXd5wIUuKtjDIfVM2JeJY0NPXBKYAgsPc0TVIgNCpiBI+upbWW4eUtsJ8J8YUAyu Ii9a6oIYAa61K/O8wuLF6/Qjc2KS7w4uNLyctf9TxYbMTBgXTMZ8RcqEdQEoVmBoHy8k m9F5yEkkWXuJicTQcXp5OGlfbnJFpxvpMpLgTlJ8ht/tImTRqoG25mYLLln9V2IO+VfM TaCUcF0qFxAwmr2vEOb45zBNt8I3Fxod4nQULqB9swn+FpfiiMaYYDmqspo4tmEWFd4F U0sfCvNwgnGvwgfLLucCrl0PKYvGrjxEvrQ9/LkGOxLDOoMQ1PUDcb9oncDuZxzng0L2 9Kcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c2vBzZEh; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w12sor6707232pgr.60.2019.04.28.13.29.15 for (Google Transport Security); Sun, 28 Apr 2019 13:29:15 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:6cc4:: with SMTP id h187mr42590160pgc.437.1556483355519; Sun, 28 Apr 2019 13:29:15 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:14 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 04/19] spi: mpc8xxx: Fix space after cast Date: Mon, 29 Apr 2019 01:58:39 +0530 Message-Id: <20190428202854.8590-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c2vBzZEh; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Fix all "superfluous space after case" style errors. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 0393765b6f..1424e7febe 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -82,7 +82,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, uchar char_size = 32; debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n", - slave->bus, slave->cs, *(uint *) dout, *(uint *) din, bitlen); + slave->bus, slave->cs, *(uint *)dout, *(uint *)din, bitlen); if (flags & SPI_XFER_BEGIN) spi_cs_activate(slave); @@ -96,7 +96,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, char_size = (bitlen >= 32 ? 32 : bitlen); /* Shift data so it's msb-justified */ - tmpdout = *(u32 *) dout >> (32 - char_size); + tmpdout = *(u32 *)dout >> (32 - char_size); /* The LEN field of the SPMODE register is set as follows: * @@ -141,7 +141,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, spi->event |= SPI_EV_NE; is_read = 1; - *(u32 *) din = (tmpdin << (32 - char_size)); + *(u32 *)din = (tmpdin << (32 - char_size)); if (char_size == 32) { /* Advance output buffer by 32 bits */ din += 4; From patchwork Sun Apr 28 20:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 321 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D302B3F08F for ; Sun, 28 Apr 2019 22:29:19 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id a141sf4426618pfa.13 for ; Sun, 28 Apr 2019 13:29:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483358; cv=pass; d=google.com; s=arc-20160816; b=CG9vWxsmxZORaWXVcmfbjJHoivSIqm+msMBKL/Ei+xJnoN5gCmT9cVzLcfdzjGJ0xb LCIHn4Iaic/22MAChPTmM94mMzvYCdECs2LUG/4xjp5muTPNjlln4C1G9jGrIQmFUoHW 8Ld92qHiPNTuKe2opkePCapC2PHGhMVso58dUyjw/9VF7AxhG4xtXTCwDo3as83W1pUm WffIREvyPSfiuYJu3UUeQvksXxk8bQOOCN/Q0MO/f3YX4OdPRK88D1elWkrSW4jyvo1s LDekEICq0vNu73iHFuQYcLNLVOYRmY4YA1nQlD9PdvLcU9kHB/zN1oEB7JkLA7hhanVm g9dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=wuFuGi3SxRJp+wnE1rzouCunSNPXdJ5Qt5SqlE3J/UQ=; b=aN3e6vmo1HjDIObU35V0AkZK2Rm/z3pjKccmC8H5oW0Wba91ZF5hO/pbKdDxpibViu 34jb+sFaHrPtBpDmknozKMbywjJqNyfDQrvURRQ8JXbjtR90IaP/v4ZNho7Ttd4zTxaO iCsMLBrPHeR0nWDUGUzY1/w9ZOWSKr4SjceXcheOWlNPkXl6CvSAALPewh4Jvsv9Xz2S O2V8pH8YIEspg4LPqjNVkTky0EAVdFoy9qek3lvJW5dMGsOgGrUH1YmjvIKuUIihd+qS Xg0eLOjxWnXdnOoEWslP7f/nyiqHjIU1vpMUU4q97ljlH65nzKObFU+NVc2ABIjuac1A qS+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CD258NEf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=wuFuGi3SxRJp+wnE1rzouCunSNPXdJ5Qt5SqlE3J/UQ=; b=VjZH1AyWBFJPfSEZn4+6ZrhiRt7LkQh84CBctY1Eo+yTZZqSeJdEwvoyQib3DOn4rV wU/X8LdF3VkrTy0311byVZigqIIWJGyLNPnfZDcfH16tSKG31xfiCNbnP+mSaZ5he2ld /q3/6hcwxoxpmgInpT2JiLsBr168x6XLwWpYU= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=wuFuGi3SxRJp+wnE1rzouCunSNPXdJ5Qt5SqlE3J/UQ=; b=i/YqjK8jdHDFt09h8sCTQSyB/g1zaiX+grb/ygDLtsZog1PkorzC9MxAL+TPIu5Wo2 biQ3KU+PO0M+uaYPVFwAA0Kaq1zpdb/8T9jnlIBoXfKfofVoyKQXoknyUYLr10fDCNHX 7XpdaTD4Vab/H/YlgrZ2GFFWAQSHrl9EkkldmuqxXRVbJeszAsMlEluUhdZZulCuXYmd qgUU+5Estbrh9btsAC5kvd6w9rMah5CKzW9oNAdEMw4jDjXw0B5SdeU/B4QV5H5PlBQA zDeOiy4Ny44D2ugdeIEsqIb1Xm68Z1hWdIXMLNROSQTGjbOcq5Um+qyiInBeBAX/Byu3 7Ekw== X-Gm-Message-State: APjAAAVkTMj3FZqN4SWLXQX6dtmpDrHzjBPvnVJGDGa4Zm0WEjlFFu2L 4Fw+41l4DyNhB+laVeKPSfdvOh75 X-Google-Smtp-Source: APXvYqy7Tu3gZB2kL9LFn54O5W+6+Cb2aanssbzZAXwsWlqTuYDQFsez0RQOTL3F6jc14iZOB5Bsrg== X-Received: by 2002:a63:1558:: with SMTP id 24mr36807260pgv.126.1556483358641; Sun, 28 Apr 2019 13:29:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:5342:: with SMTP id h63ls3267643pfb.15.gmail; Sun, 28 Apr 2019 13:29:18 -0700 (PDT) X-Received: by 2002:aa7:8392:: with SMTP id u18mr60977823pfm.217.1556483358255; Sun, 28 Apr 2019 13:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483358; cv=none; d=google.com; s=arc-20160816; b=jT4JuajwW2FbvOYrQxszrItZVKQNIjNQq8fni3ZaUdKBhlSWO38lxIMycVQVu1stVJ um1dKuCXpFdwPRY1zD/+qEZUmkHGrgqtWjNf1cTiqtEEi3MLn5LHcj66qFlGRKgk90dA 3M5EwZbFbJIb21Z62h+6DR5+V0/E1oUllbRyge9GdI2LtOk0755EvIK7+jPP/xNtZURY h5QIsN61l1iGBPZIi908qTEjzITaSgxDVuUSjGj+2kkc2DgvgT96j5gIInHzFywVVT8P h3fmkASfL+vCMp00HDCsP/pazCLyrAp2mxZtQmnk23BilMhei557wMiYXJ/Gz8KMDPue 7X9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=G7AIHLmAS66RR8+cPmcKh66XwDN0DltyVAK/3cKVBx4=; b=Nj+eJUErtx8eaSnkFR7N8EEFIWRLQrDwp1w6VQq2z8/gmjrnuvkZo3pkqpp37lIsN/ LtECqN6DJr/KRUn6JRpmUC2OM9dbaM6vqwC/RTEACsPmusfWBet+wmHUpQXjXoDTI+WO 3PELyxVjMnDRZQ8LBrkHcacfCq436tI5tv0XxfcjmJm7U1qoTvteKlTlDJyBIgn1lh/Z IZV7mEc7/dEaKBcny90cfRLo0nm4aBZjhHYe6vktFPhsLG004WYCFDHgEnvsSrihrWiZ VMO/JH5oYpUH61AizKom7sIR8hf28+cgZK/ZnkPChSSGqUcEFleCar6EozMmiMMmScV5 b6Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CD258NEf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h36sor31057317plb.65.2019.04.28.13.29.18 for (Google Transport Security); Sun, 28 Apr 2019 13:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:29c9:: with SMTP id h67mr58641065plb.114.1556483357969; Sun, 28 Apr 2019 13:29:17 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:17 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 05/19] spi: mpc8xxx: Fix function names in strings Date: Mon, 29 Apr 2019 01:58:40 +0530 Message-Id: <20190428202854.8590-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CD258NEf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Replace the function name with a "%s" format string and the __func__ variable in debug statements (as proposed by checkpatch). Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 1424e7febe..91b639f1e6 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -81,7 +81,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, int tm, is_read = 0; uchar char_size = 32; - debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n", + debug("%s: slave %u:%u dout %08X din %08X bitlen %u\n", __func__, slave->bus, slave->cs, *(uint *)dout, *(uint *)din, bitlen); if (flags & SPI_XFER_BEGIN) @@ -127,7 +127,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, /* Write the data out */ spi->tx = tmpdout; - debug("*** spi_xfer: ... %08x written\n", tmpdout); + debug("*** %s: ... %08x written\n", __func__, tmpdout); /* * Wait for SPI transmit to get out @@ -157,9 +157,10 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, break; } if (tm >= SPI_TIMEOUT) - puts("*** spi_xfer: Time out during SPI transfer"); + debug("*** %s: Time out during SPI transfer\n", + __func__); - debug("*** spi_xfer: transfer ended. Value=%08x\n", tmpdin); + debug("*** %s: transfer ended. Value=%08x\n", __func__, tmpdin); } if (flags & SPI_XFER_END) From patchwork Sun Apr 28 20:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 322 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 283733F08F for ; Sun, 28 Apr 2019 22:29:22 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id f7sf6119480pfd.7 for ; Sun, 28 Apr 2019 13:29:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483361; cv=pass; d=google.com; s=arc-20160816; b=fFEW86+Zhm7k3qmofVvBh2ZX0Q1dLVmWtKGMrwejru1w7vrfiNb53dVapdJ6XqtNMk z2u3ADPIP1tODxCsqbN6sb2x6g0hDS6U0ywRufRIhPjd2CjuWAakIJ9dLRSgbhJ+Mgmz 3GlsA60SAu+9yZFByrU1sb80XG0sDR9c/y7FTbka+GEuE+V2LaipS30nG16/CnC8YZez 62B0qVJ4g/77sg45L8dOyG1wH6BaQ6FMYS7Y2QnCDKi9od295j/gMUiiyjiPM/F3zJXs Dvy/HFIXsTNjHH5/mpWi/+U1FaInWw53CNUMroetmwSNH/KIcyHW41bovIr2ymM7Ff0L 8Sfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=geinYyYYsNoCs/KSfmpDUc3iHLrK1kor8kD4YBxhmao=; b=L71wuZDvc0XCXk0djNdhNFdxZ6T5pSpgKsmqIId1e9D8xM17y//DgFzWryY9CSgFJ3 cLqGJjF3NajzBXv+Cp4bVbVo8Jo9FsshYOn7RNoKMAlbimICyUOIQFGb3lBRNQLcG9le oqDbjH0Mj7fBruf7aCDU6JDT2wH7GPA0b7m8iVTvj6e9usPHWKDl70bsVPMkeVkOR96M rO25BMujT2lmSVEQQrG34FBs37aaafiGqopHuYBXku7MvUpjLl8g2dd5L70fWKFzDcej /jNYl7HA8/L/xNPARDwgFUzph+BpR8PHPQ9A5/XgfB1ULUNn542LRI7fvGJydPjIwnyD IOKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p0VCetkn; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=geinYyYYsNoCs/KSfmpDUc3iHLrK1kor8kD4YBxhmao=; b=VErl+vfmAMyY1aqLEszpAHGMwtve9ohUcfbht4Q/hXF/o1+keNLEbz64rnbX4Z/VBF HJwLFdbttUWiJ31p9ARLDn+JAoTKYfBtM3lA+Hnbhx1seLl9kTYpYL8+5sBECLpLG4c+ WhrAj/1RHwa6LvWmeLAZu9TZc90T0jibNWYyA= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=geinYyYYsNoCs/KSfmpDUc3iHLrK1kor8kD4YBxhmao=; b=fOp9zHM1gqYA4+pzHe1D0n89WfBL0Lh5BDaM5ijhpO2iiMsGvMIsq2HX72HTcwXCSt 2z2Bag4rhbqEYosXZcz3KM6XYfZUbx93A6cYkypNi7zDDg/1WqseC56yPNZzHGvvxakG 1bbfE7s7XVZWdO+p9wJdEDdRz0vPyHZgO1m7eoilgJfsWVefoihoNKvpLDXkssjsWTCX zo8GD9Zj+NQFcfGmcfhaGm9fjt1+55a3agh5jURuDraY7DXnyzTbq/15YpMQ26wrdY8y 20zbbo07LBXxQZQwvLbaaF9Tscd/vJayn/M3kXwzff+tMpS+H4/ZP1q486PNikju3byx A0hQ== X-Gm-Message-State: APjAAAW74cnbw7t1PR+rLJdGVP82OYZkTaIf8jvA+/ky31lzUOjHzfUr BScwXFBWkDj7jhrR64Qo8frN9lDO X-Google-Smtp-Source: APXvYqx1rY89J6Y0eeZ1yl1p4yr6ox7oQ8M+ZAFz1+NyQ2FjUDiWeLlUJw+7HONCfbs/3x+yC9iWNg== X-Received: by 2002:a17:902:8f82:: with SMTP id z2mr5226132plo.51.1556483360997; Sun, 28 Apr 2019 13:29:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:8a82:: with SMTP id a2ls401233pfc.13.gmail; Sun, 28 Apr 2019 13:29:20 -0700 (PDT) X-Received: by 2002:a63:5466:: with SMTP id e38mr56363805pgm.340.1556483360600; Sun, 28 Apr 2019 13:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483360; cv=none; d=google.com; s=arc-20160816; b=c4J0uUnvFMPYYQHcvyJVtOnvVUkp4DyQ+rFAveiLYVumlDnpk7Pbd+MFao8xbot9v5 v5FWhoeGGWvJLrUnOzfVbOABA0o+6n8hjD77Z52J2j7ODVnurBtowk5fg20jRRvau2n2 /wDQcfRwX2rVmDp3W25fSvaWOcWF9gelVwdA9LqydehWw4XFarm95pmlrn9ejI6vS3IV ogM4Dd8Xpo/J+UkLlx+xDRH8+A25eXaSyI/tdqLY9S/ZcO1GD5GlTrUbmWSlhrY5uiaB TNeN87UjiwODJJv8yIQzcjsHV2zY5AAtqsFfPu23N7OuvZxf+YFr+fIFds9AMYmAuaCB BI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=nSqHcrr6BR1bt08FkCONc5tzPnqtk3OYZmvPa2WM1jw=; b=0hkpjhqTLHOIsMrV3g86Ge20xfAZNQSud4dJMt/KNs2pkiaXMFinL4O9wSkzt8+9Wy ntJoGKwxKM5uTK8uqpCbS/j3ihzZaoBwEiPt5NKvk1ftVxtcfBCLhg2uOdbt8ZAt+sVx A2m0crTi5qyWRId/a0tLElVXT9A6ki03wwm0XD/BMrK+eAJdVZbcc+lLWGf7P07OAoj5 vBJNu6fgiszcGK3LSTykkNQse+pxT7Q5qnu8NmEWf9YKObna5hXrrYzzd2D8AgtaGiyn Lq3j21A0DqATSSKtuen+wtd6nrofZozG9DCCmPNftS+CryzXHW/8pYof7AdTGC0IjA+v mtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p0VCetkn; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 186sor35625886pff.48.2019.04.28.13.29.20 for (Google Transport Security); Sun, 28 Apr 2019 13:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:6a81:: with SMTP id f123mr60400771pfc.40.1556483360309; Sun, 28 Apr 2019 13:29:20 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:19 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 06/19] spi: mpc8xxx: Replace defines with enums Date: Mon, 29 Apr 2019 01:58:41 +0530 Message-Id: <20190428202854.8590-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p0VCetkn; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Replace pre-processor defines with proper enums, and use the BIT macro where applicable. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 91b639f1e6..7b2ab1e4af 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -10,13 +10,25 @@ #include #include -#define SPI_EV_NE (0x80000000 >> 22) /* Receiver Not Empty */ -#define SPI_EV_NF (0x80000000 >> 23) /* Transmitter Not Full */ - -#define SPI_MODE_LOOP (0x80000000 >> 1) /* Loopback mode */ -#define SPI_MODE_REV (0x80000000 >> 5) /* Reverse mode - MSB first */ -#define SPI_MODE_MS (0x80000000 >> 6) /* Always master */ -#define SPI_MODE_EN (0x80000000 >> 7) /* Enable interface */ +enum { + SPI_EV_NE = BIT(31 - 22), /* Receiver Not Empty */ + SPI_EV_NF = BIT(31 - 23), /* Transmitter Not Full */ +}; + +enum { + SPI_MODE_LOOP = BIT(31 - 1), /* Loopback mode */ + SPI_MODE_CI = BIT(31 - 2), /* Clock invert */ + SPI_MODE_CP = BIT(31 - 3), /* Clock phase */ + SPI_MODE_DIV16 = BIT(31 - 4), /* Divide clock source by 16 */ + SPI_MODE_REV = BIT(31 - 5), /* Reverse mode - MSB first */ + SPI_MODE_MS = BIT(31 - 6), /* Always master */ + SPI_MODE_EN = BIT(31 - 7), /* Enable interface */ + + SPI_MODE_LEN_MASK = 0xf00000, + SPI_MODE_PM_MASK = 0xf0000, + + SPI_COM_LST = BIT(31 - 9), +}; #define SPI_TIMEOUT 1000 From patchwork Sun Apr 28 20:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 323 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 81F423F08F for ; Sun, 28 Apr 2019 22:29:24 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id p8sf6142728pfd.4 for ; Sun, 28 Apr 2019 13:29:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483363; cv=pass; d=google.com; s=arc-20160816; b=r+2GG/DMK3JgToXbCRM1Di86yda0yg91fFjJ5EBBxOlyFDHETgpttT1zxYlSSwzCxb Ni9BALS8v9DBEZuLamrQzevDFKkiAH/4OJEYn2i3k4zUHfiqbR4me7IPWlql31/xIDbf Lc+2g32Fky2gB1fcmavVmseced8tV7PuiVtTtPq5VM/3WmU+pK47YpuZZRQTraKC69hR Fj/DbXWSXdQGILxzpz5lhSytfMIhaict5QX2tN+uZJKFlXGWA/tN+MVpswPe8psmsAGO wMe1dTecpJaEYAwClj04lCi/GRUNk6LQt+VwIxFZm096Qo5xeAZ4Q5K8gOzzxBQ+m9nR Z8xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=v4HRyKFrbVB2dt37tWqd2iVntqv9jaJKC4id3NI9dpU=; b=i+1Bcmos1OeOAPrVUm8syT3Fk97fc7G0WZv4EX5Dzk++BlDU0Ge9a89ZQDzxkjwQpM pY0pv2t4n5OIk1gyjoree0lR6FKKli2pfxHb7TJrKsmkzOykaKeNi1BeGOR8YJxhpWsh v+58wFYxp1gWNFQyxopr1NDggy42q90F5VTmMB9/YbaGNqMylWk27fARzdN9OdB6pL89 hC5P71w2k2DGtCgofTD06Erzt0IlR72tLVfp89YvmvWfhM2pPWd35ztfeTFifRjuKRsi 1n5ILULq07aBylZgGluq2qBr9e89h7Bti+Pno8lwGs8osqUrQ03sAYOXYrXT4kmBpRJM 3bsg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fplu6g99; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=v4HRyKFrbVB2dt37tWqd2iVntqv9jaJKC4id3NI9dpU=; b=fIrxc/NQ3smm0Kx/KEkeULezLteFQa07UwyZg4M6QeiBiDGyybrqXKrdJmZNpnb622 j+sYVYZUWTsKV1HZk4GxSlZpanbR/8ARGSzC7sBYJSRUTD9ca19/tf4l1U72tvUzrDiR qR/6DxedYznGaBhXumjksOcMof44+vAN1cqhg= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=v4HRyKFrbVB2dt37tWqd2iVntqv9jaJKC4id3NI9dpU=; b=QMiA0IUa+JGgxBz4hf48QhlkW+uSdYI9Sfl5qhD+KL8NFos58LB1CrLMk8zVjVRXvD iSS82rYYOvL2dUtZERCkV2PinNZt2DJwz0G+GYp+yro/QY4fFHpPRDTJcXkgEIOy8pSB 2KBmy40DDKVkaglmSYqL9Xpp1W26IlNPZrVJW4IU5S118MAkJnPIjvG9xwGVCCW6OjIh bLNeUKb2hYazoZp+7fWnQuuQ9vYOoP+xgw8J9MuGBmtTjYTD1JPd9IHsX3CWnlvW+dUf ekbOiyhsTHJHevdP/qryiq6jz17qWmE26lZ7dYpEvYi2IBU3tB8T6zrr2wgeEdCnkzAK QYNw== X-Gm-Message-State: APjAAAXx3De229jVgsD0bb9og8JQS9eaTH8pLZoOfzto+480xC+PQUWZ Cksdc7CkK+p+36pHnj6u8szGpD1X X-Google-Smtp-Source: APXvYqxe/yBjUAafjHaKOaYxZUzKoNDT9133kc/uoOCuoAXrUe9XqrzbY8NT8sDsgpFLtNz3qYtQnQ== X-Received: by 2002:a65:4302:: with SMTP id j2mr54868859pgq.291.1556483363348; Sun, 28 Apr 2019 13:29:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:120a:: with SMTP id a10ls883125pfj.10.gmail; Sun, 28 Apr 2019 13:29:23 -0700 (PDT) X-Received: by 2002:aa7:8c84:: with SMTP id p4mr40899355pfd.164.1556483363001; Sun, 28 Apr 2019 13:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483362; cv=none; d=google.com; s=arc-20160816; b=pey5bFtXgHIiK4WTHqhONt4JtdoGHkEzE6uZJm36A5DftXIF53SODHb8m2spOo75YD CB8tnhWstFbr7BK/MDmFY4RnZXm5VAZB/B0cQhkzyT7WkHiWsOM/1m/i3h1Lj3CiqihG pe8nZIUUZnlyEfQJyTP6A+8pTvLWNrljdGbxFErk6v/3FmTHNVZWzuuJ8RhY0Z0b+8ol MepV0wfj/kFDX+hQTnfSdjpXClx+XjN9GTBhqkuZ+79qmf8iBd/CgitP4vDV7Jo6TL+n pEd1s4CpgjA89M7TNzobahUKy6Jnpd6Iczc9bB8PiLZEH0Eq5SUe9Pxwkkic8V+czb9M bJNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pQRuhVVoE0yWd3mKjSZGAd435raNgPLT517CJjGksNc=; b=stCH7IcWWAcNXaCIVsqv2kjid6XUA9EDrfjssdfh3jgeuoAlO9a2JEx1ZE8Af1yZ8D O7DxT2Akm6C18FeZZjF5YAhTWZlvhvvp+arPOTMN5yEedZlaAxPPTrFf+DS8WwVyfrxh KrMzu9hxmjsKNDsse7YLYFNouP6a9kgvfcWt2C16Uv3sf0V9HK34XVN9UyUp4jaT3LNB RKmftHzgl/1IIVenWRirgVIIPb5q+ZN2TE6JBhm9+2BaGJvW76qEHgC17uIapusmO4XS pvaPjlRf/XcMLsr5sGDFw7cKRzBZCHCnd1tPzIhgEmygxculkkdUJdyKz4PgXxbAtqzx DFBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fplu6g99; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v6sor30838729plp.3.2019.04.28.13.29.22 for (Google Transport Security); Sun, 28 Apr 2019 13:29:22 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:2b89:: with SMTP id l9mr3789693plb.331.1556483362700; Sun, 28 Apr 2019 13:29:22 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:22 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 07/19] spi: mpc8xxx: Use IO accessors Date: Mon, 29 Apr 2019 01:58:42 +0530 Message-Id: <20190428202854.8590-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fplu6g99; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Accesses to the register map are currently done by directly reading and writing the structure. Switch to the appropriate IO accessors instead. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 7b2ab1e4af..da9e1e3f98 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -58,21 +58,21 @@ void spi_free_slave(struct spi_slave *slave) void spi_init(void) { - volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi; + spi8xxx_t *spi = &((immap_t *)(CONFIG_SYS_IMMR))->spi; /* * SPI pins on the MPC83xx are not muxed, so all we do is initialize * some registers */ - spi->mode = SPI_MODE_REV | SPI_MODE_MS | SPI_MODE_EN; + out_be32(&spi->mode, SPI_MODE_REV | SPI_MODE_MS | SPI_MODE_EN); /* Use SYSCLK / 8 (16.67MHz typ.) */ - spi->mode = (spi->mode & 0xfff0ffff) | BIT(16); + clrsetbits_be32(&spi->mode, 0x000f0000, BIT(16)); /* Clear all SPI events */ - spi->event = 0xffffffff; + setbits_be32(&spi->event, 0xffffffff); /* Mask all SPI interrupts */ - spi->mask = 0x00000000; + clrbits_be32(&spi->mask, 0xffffffff); /* LST bit doesn't do anything, so disregard */ - spi->com = 0; + out_be32(&spi->com, 0); } int spi_claim_bus(struct spi_slave *slave) @@ -87,7 +87,7 @@ void spi_release_bus(struct spi_slave *slave) int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, ulong flags) { - volatile spi8xxx_t *spi = &((immap_t *) (CONFIG_SYS_IMMR))->spi; + spi8xxx_t *spi = &((immap_t *)(CONFIG_SYS_IMMR))->spi; uint tmpdout, tmpdin, event; int num_blks = DIV_ROUND_UP(bitlen, 32); int tm, is_read = 0; @@ -100,7 +100,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, spi_cs_activate(slave); /* Clear all SPI events */ - spi->event = 0xffffffff; + setbits_be32(&spi->event, 0xffffffff); /* Handle data in 32-bit chunks */ while (num_blks--) { @@ -118,26 +118,26 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * len > 16 0 */ - spi->mode &= ~SPI_MODE_EN; + clrbits_be32(&spi->mode, SPI_MODE_EN); if (bitlen <= 16) { if (bitlen <= 4) - spi->mode = (spi->mode & 0xff0fffff) | - (3 << 20); + clrsetbits_be32(&spi->mode, 0x00f00000, + (3 << 20)); else - spi->mode = (spi->mode & 0xff0fffff) | - ((bitlen - 1) << 20); + clrsetbits_be32(&spi->mode, 0x00f00000, + ((bitlen - 1) << 20)); } else { - spi->mode = (spi->mode & 0xff0fffff); + clrbits_be32(&spi->mode, 0x00f00000); /* Set up the next iteration if sending > 32 bits */ bitlen -= 32; dout += 4; } - spi->mode |= SPI_MODE_EN; + setbits_be32(&spi->mode, SPI_MODE_EN); /* Write the data out */ - spi->tx = tmpdout; + out_be32(&spi->tx, tmpdout); debug("*** %s: ... %08x written\n", __func__, tmpdout); @@ -147,10 +147,10 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * The NE event must be read and cleared first */ for (tm = 0, is_read = 0; tm < SPI_TIMEOUT; ++tm) { - event = spi->event; + event = in_be32(&spi->event); if (event & SPI_EV_NE) { - tmpdin = spi->rx; - spi->event |= SPI_EV_NE; + tmpdin = in_be32(&spi->rx); + setbits_be32(&spi->event, SPI_EV_NE); is_read = 1; *(u32 *)din = (tmpdin << (32 - char_size)); From patchwork Sun Apr 28 20:28:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 324 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CCDAE3F08F for ; Sun, 28 Apr 2019 22:29:26 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id g1sf6142505pfo.2 for ; Sun, 28 Apr 2019 13:29:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483365; cv=pass; d=google.com; s=arc-20160816; b=aBkf2Q93lPXKiEp+oURgqHuJN7nMeTSRSwQbOdRaPmaQdidyzrcJfv5DuebWiStb8R /SygwLYpPxMOU1fMqEnCPnQeykTQfMbIOANe78N4S85QZDgkZVyV1QQA7e2y8zsdJVt7 6PsQ2ZwnpFeAJOdQLL3woClOC0i7ohHL1q9GCB2cI5oM0cCU3Ewg6iLurfdEz0foEahg yqYE9zBJnMe/HVs2SOPJ4k/hvpyKxbdhWpPGJqnjznDRcGYWShN/PVNxDZwn+KAL+RgQ 1KNB96YxEaxEMlnXQFbULKfmls7nTwA80WO8FocidaDgUU7oeSokE+yzm2kuix3IA2SK ljgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jc7M9SxfnXIA0hRxgIT58mPu8h1amSoU6MjCzMhpBlo=; b=a2LhdcK5F8N6KPcWRb8vWk5j8wg/dk1cF12e+Ll3wU0Nniiqbq/EeuNhFrmrvd/1Bb 4ygjIgCcn880VUgSrVbXV380/Lz6OeevmP02zWbJpLGwjndyR0RM4t404DultyIUB/8U +D/YDn0HH2LOClIcenN1/b0Xq59i/gWZwE3VVBYd3AgA5EsqN8nJ/gNSZlodo/EF6RGu YBZWaQSOwVVNVGBIqhVkeITRkkFAuOFPq2UqdEktEFpBSalEzU9RdHgH/kHqFyJf3C8O MWDZccgNQP7W2h3b5Z9N5a3X8JU3ZHL8w7in4is3AIf4n2qTNgcE4GzW8uFqjiQSV/XR y+sQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AlC+hMGl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=jc7M9SxfnXIA0hRxgIT58mPu8h1amSoU6MjCzMhpBlo=; b=dYTIISZtUigWki0fLuEu7MnjIWYxbCU8swuYrtdtB6rvKu2A159xhRidVlSjcC348k /nsMikucvDrc92wb2JFygqC44izJIzY7L/SHnaHOMhBmp1qDSG3itShP5wBC6Hz4Duuf QzdTVDZ8QQH4DuR+TduJM8lAa/pA6hLKPg68o= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=jc7M9SxfnXIA0hRxgIT58mPu8h1amSoU6MjCzMhpBlo=; b=EcMJNzNfGMxPVeUmE5loyFVxaD/2G3T46prOLXVZt08rz2UwhxxSSrIN15waUBR43J pp7B5xmCF0QoJGMJq0q+pjKjc8otab003R4mo07hJKedOGKvBuAHRAUTRThalx6iRxAx ZHMuk+zhIzeJABx35L8HxcwGBs3XXm2CB+xz8vwuX7ZfY8dYqm8Qa+LaqQ2YrBn5P8b3 oPI3GS1jCo3Y4oxA3es2331uJ42UJewaxxRM+ajlRiMOvciZ/Mc7qU+3DdrerSnNFZSu Gn36ZwvhczuHHK1NeJZu8MLEgNqd6Qcl1I6abMIQtw+4RfVs7QOFwdoKm19EcRBMNA5k wyEw== X-Gm-Message-State: APjAAAU22xN/umU9IU5KppRTO8+lsXhwOQ/ZMUA6z4J87o5rvmik2Mgz R4s1Yaa1WovEickZsAyr7VcxCYT4 X-Google-Smtp-Source: APXvYqzW6EtapgNpwOnmlFklGfKNyCUdOXk9Z21+kMVGtbtWRO4SzgaECkZ6+LkpwffppWajTMAAYw== X-Received: by 2002:a63:c54e:: with SMTP id g14mr55201009pgd.265.1556483365629; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:690a:: with SMTP id e10ls541262pfc.12.gmail; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) X-Received: by 2002:a63:f058:: with SMTP id s24mr1878740pgj.257.1556483365292; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483365; cv=none; d=google.com; s=arc-20160816; b=LGdRgJCIA8Ppn0mPMC2ajUb5COi9XG7EF4iv3fS2e6NGtDFAQX/a8jGz03ssUrl42h SwB3EmLAyfvg2YyuFsZLmYbiS2GYInHYLmT9YgYCYS83sxSjotHyvST1fZJzF/jk9+SI 50Tz3ky7AyTyTOLY3qYI5lyUt3z5xtnP1FoLgTV6BiaZiKDu5iimfyDkU1xun0mjAxp3 YxSa8WTk9kAZwFdXYLxbjahtQgA5H3mhqCPov7XNAK1IM1w0QT0UdWlEYrlR5LksWUXA 1U1Rllhq/1QXghfm9jueEram6du4XkRjY+/3RxDLdRCc14Rt13fs67zXGySRVkzvokzy jr/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=b6Eec9qVRXvJMUOqgwcEo2biB8N8n2ZN2Fv/Qr8PBR0=; b=nr7t7CUlE5kPndZMRieHyElzrezC1jwuZM1WOubP+AYuR8wLYhvwHY3IvMMmlNUg8F k/16Z3euhNonoYMF7HjeRimlYIdWQad9O3wu07UD0Y7Tx+zO5sFBSRmk90+CVy8VKWkU jbhc66NrW/BbGKkFEW+JFu4O8W5ot1P2Do2Nn3owgVpz7Idp8BmIjdrNCdGp0NWjHqh2 W5129VhKakVDjrh1NoSy+qdynDd345ZfXidmKUz6YbFnicSp0OZvLdXac3TvJr9vM1re JmxJagj9FRglRhlr7Kn91nuVnWKTDIm3MrPlQijiJRLxLXNtqSq1H+gwum/8UTNxTpwZ 4BqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AlC+hMGl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f23sor6981580plr.4.2019.04.28.13.29.25 for (Google Transport Security); Sun, 28 Apr 2019 13:29:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:86:: with SMTP id a6mr57641661pla.277.1556483365043; Sun, 28 Apr 2019 13:29:25 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:24 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 08/19] spi: mpc8xxx: Simplify if Date: Mon, 29 Apr 2019 01:58:43 +0530 Message-Id: <20190428202854.8590-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=AlC+hMGl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Instead of having a nested if block, just have two branches within the overarching if block to eliminate one nesting level. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index da9e1e3f98..ca34570901 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -120,13 +120,11 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, clrbits_be32(&spi->mode, SPI_MODE_EN); - if (bitlen <= 16) { - if (bitlen <= 4) - clrsetbits_be32(&spi->mode, 0x00f00000, - (3 << 20)); - else - clrsetbits_be32(&spi->mode, 0x00f00000, - ((bitlen - 1) << 20)); + if (bitlen <= 4) { + clrsetbits_be32(&spi->mode, 0x00f00000, (3 << 20)); + } else if (bitlen <= 16) { + clrsetbits_be32(&spi->mode, 0x00f00000, + ((bitlen - 1) << 20)); } else { clrbits_be32(&spi->mode, 0x00f00000); /* Set up the next iteration if sending > 32 bits */ From patchwork Sun Apr 28 20:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 325 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 51D0A3F08F for ; Sun, 28 Apr 2019 22:29:29 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id a141sf4426745pfa.13 for ; Sun, 28 Apr 2019 13:29:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483368; cv=pass; d=google.com; s=arc-20160816; b=GgXGzihvyRmS/83y0MKUnTgh+TqOwpDVw7/jusqJ4HLdHU5Ioz6Lr7xlnmLdmDMVAH VYE7Hf4u4Bdjgb8Sx6Qat+OYtVPoRVFnPPxjp80isjNbIOmrILyJ2tfOJTNMbkjcp3OR 0uM0iWJ4+tUR9JqpFbF/EvvHTbyCddS3FSwM9cwh8dIgd0OOw0k02ogzurV44F/fPCS3 N5fF1g/cviyxn7lpZ58Ve+RD8Vza9usdbL3zlflPMswhCNFTJmXpcOz/m63gxR1BcipM fr9/G5F9voGlSgl8zZTgP+UY7nTWKp4ZQd9YBhDVubEVsPPsRybPibQ4/+0vMWSimKCy OWTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=iH3ONbWz3L+J5LVdZ9e/m3CMBEfTU8Uctqn5xwIiKWY=; b=Spnqs+CPw7Mp+V8wCZDgx10kfOKEsJAre++uBgUCWwyFQN6wbTs1JP98gPnMXPJyWj fEhFJq272hPlFYy4HoakQWwYG5Tx4tTV9GsorW1tOl5H02Y7wij1k38b9gi2R+l/gpG5 mUmgek8bGoZz9e12Ahy+0SLArD/Nrm1d4TzNHMCQHv6tl6rqVUkJCsurgrrufS7afp6d mMStfWDf9IOdOUCXPZxpeIOy8sdJxOkGSoStUxFp7pEn0Hy1CpUoLbFyOUEX/caoJBIg vSW1KMqlZ9ZSa9WrYxvx62ym/JDZFqNgMhAENN+eWWSaad15ei2mWr3smMzfL8pLzFKm pa2g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d25zGYn+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=iH3ONbWz3L+J5LVdZ9e/m3CMBEfTU8Uctqn5xwIiKWY=; b=oi09IiM3pMWjOxQohOzSZkVG+v8VdgIAXsAN7ySmcqzHj3KOOTMDJP1YT2G2lJsdSb 62RgFALVLv/vdaxsMTgBSW/ULlgL/Ygh8eCCq4Rt86KCpuzjiT+60auzUfZOEUOVI3pX hT2zcKIubbTaAfFKWggcK0Tuc2CBxKFlovxHg= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=iH3ONbWz3L+J5LVdZ9e/m3CMBEfTU8Uctqn5xwIiKWY=; b=gLo6q5D2lD05cLxcVHJMVqoixRNu2pjAQAX1oII8tDpxs+x4kFop1OR9mAtPHXuPlr VmXcByQdPwogCR38EPvVgIPs3uRfI5xMfkWHsbnz9+kF44w+vzHxCtMoNiZoG/PMV4WS Iu7Vh2iNLkwXXoU5YYNg8VFm2gdqNZm0w6ydrLi+JR4ggD3+MG8dJ/BpJNyjGH2Uswxz nlI7VULzL6v4eJcCetEWkBCeIFWTjHlJj6bJvg1CdzB2PNABdnW8zexN3+tDXwgBO97n ztJ6V34sqB/bAtlJJ7IafxXkPjlvwRvQhsW2VtxcY8EywkYbErPnAsoYhNjTzo+smmlO tfDg== X-Gm-Message-State: APjAAAWgZdVFtUUT/Sbl2WENKkoJZmHLLLZYvJSTqIDqGy+Cx8vrGZWH QH7Xetskf7rqoV/fwqsSjZAjDnM9 X-Google-Smtp-Source: APXvYqwdQJzhM0VCGAZIyopBV8YCZUE09zHZxpM7wrkJbYhDM9EiRkK50BWf9WuGe4bjWhnQe+NHuw== X-Received: by 2002:aa7:9285:: with SMTP id j5mr30718105pfa.129.1556483368120; Sun, 28 Apr 2019 13:29:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:6085:: with SMTP id u127ls363069pfb.9.gmail; Sun, 28 Apr 2019 13:29:27 -0700 (PDT) X-Received: by 2002:a63:a42:: with SMTP id z2mr25759320pgk.262.1556483367830; Sun, 28 Apr 2019 13:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483367; cv=none; d=google.com; s=arc-20160816; b=KjVjPVuAihUSmmTumV8VezK1cnWt6pv8fACY1M+7Zt/jO9dOPHjdU5BF8s0G49GaEU Pys6kKvArYtJcKBwyTJ0CPB0whW1g9cHHKcCoDw3Mhx+danJIPHvIvP2hMjGyz2FdZBB kUBlZv169WFO+oILe5sKO+ysfYuHKJ8zziaQiZhrmpKXgj6YdJ7E/r4Tc1qq2ZKtezI8 YIlUR+rXxLafFEsZJG2A8oEWPhz/hdSTCV2UG6ve+Bt3p2k51JDKiLPZzFmMM7o0Uwz+ wYTvHZqBwQvgis9uQ0dckTl8WrQuzCLfzeimiuMvldodwmxXj2zIzJw5TaC379I3ujjf vELg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=tlg7S/5yavDNw1bG++IXicLM4kjsM/wdZz52Nn7kN+U=; b=b6Pk2fiasDv4YrGQ2pBQJfkZ1bU1CpGS194PivXb6oheyU9lAsvLeRPuyrcp4o1LmQ SxazZVxSp9DtzdgFtnWjufq6YPg9Yr3mpLNdKZM5f8cZXHTgYltEEiuGJ2ulVD5ZT3rh mAwevLGkHLzA1yW4hAlv3GbbmC09Kn4tnG78NBRSui9izfU6D6pnzHNRX++vW+wMLHuu H9oCvjGYtOx25EyWHGADEfONPfLvnJc+CZH4L7nq3OAUG08SVf5lAC02ghfLJCY/dq9K YkUBTzEuIjt3rAi2l5TWtg6xhk3iDJEgRJ0jWa1T9IvEUiOZDkuuZ5ZitSAFa1uVoLYF n4JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d25zGYn+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t23sor8507665plr.33.2019.04.28.13.29.27 for (Google Transport Security); Sun, 28 Apr 2019 13:29:27 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:20c9:: with SMTP id v9mr58111292plg.239.1556483367546; Sun, 28 Apr 2019 13:29:27 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:26 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 09/19] spi: mpc8xxx: Get rid of is_read Date: Mon, 29 Apr 2019 01:58:44 +0530 Message-Id: <20190428202854.8590-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=d25zGYn+; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Get rid of the is_read variable, and just keep the state of the "not empty" and "not full" events in two boolean variables within the loop body. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index ca34570901..962ef710f8 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -90,7 +90,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, spi8xxx_t *spi = &((immap_t *)(CONFIG_SYS_IMMR))->spi; uint tmpdout, tmpdin, event; int num_blks = DIV_ROUND_UP(bitlen, 32); - int tm, is_read = 0; + int tm; uchar char_size = 32; debug("%s: slave %u:%u dout %08X din %08X bitlen %u\n", __func__, @@ -144,12 +144,14 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * or time out (1 second = 1000 ms) * The NE event must be read and cleared first */ - for (tm = 0, is_read = 0; tm < SPI_TIMEOUT; ++tm) { + for (tm = 0; tm < SPI_TIMEOUT; ++tm) { event = in_be32(&spi->event); - if (event & SPI_EV_NE) { + bool have_ne = event & SPI_EV_NE; + bool have_nf = event & SPI_EV_NF; + + if (have_ne) { tmpdin = in_be32(&spi->rx); setbits_be32(&spi->event, SPI_EV_NE); - is_read = 1; *(u32 *)din = (tmpdin << (32 - char_size)); if (char_size == 32) { @@ -163,7 +165,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * in the future put an arbitrary delay after writing * the device. Arbitrary delays suck, though... */ - if (is_read && (event & SPI_EV_NF)) + if (have_ne && have_nf) break; } if (tm >= SPI_TIMEOUT) From patchwork Sun Apr 28 20:28:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 326 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2191E3F08F for ; Sun, 28 Apr 2019 22:29:32 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id i23sf6144500pfa.0 for ; Sun, 28 Apr 2019 13:29:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483371; cv=pass; d=google.com; s=arc-20160816; b=QgzKb2yfsW8sY0hXSnJIxSHYOZzNO6imo7NZsKfQB/L1bH3dvN4ag902QEnFmHzq2V aqWwdwdUVSWAGsmPlyb43E91CY1TIozoENNO1FSng+oARMdSRWhxJ1FgVYDsSXilBcnv /BMCfh9xEiOpJpXOOgglWE628rKjBJJN+icWlEbZWj7UNN2FoWo128Ggh9sFNc90ktm3 oTjC2QiB4cYGyDD2Po4ocW8Ef8weyjipLN9+/Be05fg8NpWWT0Cl4iEyo9G7/43S8acr 7WMLg6loZh6Lylp8RD0QfmmWNUQB9iIxM54jTU8XOJZaNg3kZEWKLwZm3FSMs3+qJBl5 sS8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=GfRvy++mcuM6fS9KVUgWjkhIL+ryW2q2XqRBfCVIqxc=; b=jqyoM/VYb5m8veYV5HfQZF5ZzFtQYrTzVc+geEWL/lUUlpYu3W5HZnIrs7WH7EWrIs gL+uZncWpXc7ZvHdHxVMBtctfpK3WXxtgOBu1qxtFjKKJBiLdZD3FDGX80pmGP1NAyty EA30q/i/8elVR+0+HH9cuSxsE2kem5dd+xNSMeaMpPHtvN3QM583/a0lWyn/gNrob20/ oQAKsExkfE8S4L2wK9IB5qWuJs17jxsHmwgpTg7j/YPTZwYTxpC+T6Q5Rfkm5mQ5QKh5 b406e8k1EinxQttD9IGIdkCouxRpUhFr69T3J3QdlkDgKNmjcrpOxbJ+j0LwRr3FTP+T 5znw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="VyJA/7wF"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=GfRvy++mcuM6fS9KVUgWjkhIL+ryW2q2XqRBfCVIqxc=; b=YEZkR9GiJ93ZUIewe0Sxvgu1eMN2IK59+hugYSWDmvSedDxttdpHKJ16VuQEUCTLO6 pLbuSViFmYrO2pFg7c188jwkl2IAfdDWYwvGvR4Amrzdd7NasxyKLfP+3sXXdXmFQqzd Rh28RXlpA9deQhWd3HLzvBma/rg3jiKLzo4R8= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=GfRvy++mcuM6fS9KVUgWjkhIL+ryW2q2XqRBfCVIqxc=; b=Wpgfm4UJAo9N/7RugslZKzCCpxHcMMTgN1Gss+H7zzhfTAqad6aKhaKX6SFsf0Aq+t bybhYpZIN+on2Znztjvg31P7Ds7GOoHrSfGAIeoXAtIUO/JN7f+uUqYN3zFQ5jjGHUOm T3Y7Z+ViuRBIJxC4mt99El9vu2o4M0cg3UBsdq6Mtd/33nneoIrYZUg1q8lMzkTqF+g9 e9BXTlBdAC3/hLE4kCIRlHfwUkSnRbCfepEmPZKDUEJORk8/jKpDP8uAoKOahXaj2Bte s01w/AyddKzRWQw7R38rfpJYmkaEQG4eZ62RUHEQCa5fxSvWliVHzA1T8boGjvp9Tjh9 zD+A== X-Gm-Message-State: APjAAAVnYkJE5THVGhhjkumTFLFU4pA/GdvbHarbpYRPhpM279LEsagm DG5U5sJAJ9uhhLBlj79KAJEumebK X-Google-Smtp-Source: APXvYqyFoVaDjWFNzr4PqqhVp28KffoBy0AR1WlqTX9zULqArpfZBkGidky19QT2zQPZs9v5VxZjmg== X-Received: by 2002:a63:6cc7:: with SMTP id h190mr54298387pgc.350.1556483370926; Sun, 28 Apr 2019 13:29:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:54d:: with SMTP id 71ls766114plf.10.gmail; Sun, 28 Apr 2019 13:29:30 -0700 (PDT) X-Received: by 2002:a17:902:9a48:: with SMTP id x8mr11144186plv.133.1556483370572; Sun, 28 Apr 2019 13:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483370; cv=none; d=google.com; s=arc-20160816; b=Rcc1ijWxkm9xas4rxJCcozjRn0rgwomtdbeyWkE3QHRrTOWfZFL285gBdVrasLHR1a ZvXdl83qUdHNWzBbyYXujbm6nD0Tsv5OyJv/dJKo0fSABmwQ3TeBkJ3TPgsPqWSVUqSb Ga8W3+egzW1xfB5CBL3sx2Q5x3AROdKu7fYsvdaoSFmS0srLNlOHkelJXmINHKGx/ek3 c3OUXuYt4OQ87yvDq6EahZOt02MKaVhEb7Yfwc445lm5tXekI69Vvy08rxG1WSo5p7fz ZTwZVzB7Mg0iF/V6gfdikvCEK4Tm9Pog6TPestRfUKh5qPN7R+i6v7QhuaGjM3uaFahE Cj6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DTO6ewJO6LxtcHMlk6isa3AoPn6RhI6b3q543pvVwGE=; b=HlunoFB+UVUSwwRmgqDasezf+DhYUYi/7kVPTEiv/oN2e8uww3Q29Ei8VkR0lY8tOW 0M6RtVPxXXSQKOn2bNWSPorcXbVWlPxdsXCetJM+zAjd8ndRwiXWhbiC7OJgBodHOBYg KPqLN2CERRSIFKtTbnte4n59MWGbfRWHLMYDnXAHML3AbVHzRRQ7ZM7DgclUoRH2csKB nFv3+2lw77ar3/7Ehau1zxpEt/FXqn1yx1dhU5NsIAAanLP8TGb4U5bqo0bgNfzFAwry uZQdiUjlO2v5s1+gmmFWvjelH7s5qVVCYVLZ3m5Oymjh7qBo2hcYSllUtwvb8RQVNEQC /0PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="VyJA/7wF"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d12sor24369689pgk.19.2019.04.28.13.29.30 for (Google Transport Security); Sun, 28 Apr 2019 13:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:5b4d:: with SMTP id l13mr54842512pgm.160.1556483370258; Sun, 28 Apr 2019 13:29:30 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:29 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 10/19] spi: mpc8xxx: Simplify logic a bit Date: Mon, 29 Apr 2019 01:58:45 +0530 Message-Id: <20190428202854.8590-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="VyJA/7wF"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six We do nothing in the loop if the "not empty" event was not detected. To simplify the logic, check if this is the case, and skip the execution of the loop early to reduce the nesting level and flag checking. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 962ef710f8..a2e698ea17 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -149,25 +149,28 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, bool have_ne = event & SPI_EV_NE; bool have_nf = event & SPI_EV_NF; - if (have_ne) { - tmpdin = in_be32(&spi->rx); - setbits_be32(&spi->event, SPI_EV_NE); - - *(u32 *)din = (tmpdin << (32 - char_size)); - if (char_size == 32) { - /* Advance output buffer by 32 bits */ - din += 4; - } + if (!have_ne) + continue; + + tmpdin = in_be32(&spi->rx); + setbits_be32(&spi->event, SPI_EV_NE); + + *(u32 *)din = (tmpdin << (32 - char_size)); + if (char_size == 32) { + /* Advance output buffer by 32 bits */ + din += 4; } + /* * Only bail when we've had both NE and NF events. * This will cause timeouts on RO devices, so maybe * in the future put an arbitrary delay after writing * the device. Arbitrary delays suck, though... */ - if (have_ne && have_nf) + if (have_nf) break; } + if (tm >= SPI_TIMEOUT) debug("*** %s: Time out during SPI transfer\n", __func__); From patchwork Sun Apr 28 20:28:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 327 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6F91C3F08F for ; Sun, 28 Apr 2019 22:29:34 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id q27sf3018469pfn.16 for ; Sun, 28 Apr 2019 13:29:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483373; cv=pass; d=google.com; s=arc-20160816; b=hJep3maKcxrHCFoob4scmAnexp4tfoQ35jd/qYqjRLvmGELLjoZ+Zq8CQs88B40ALN RfzbCH+wBp7/yeLAr8GWteTVD05HTqfgzsZQ1btjx9dG2ueu0rhhmvpVA+Tgwygt3Tkc Pm++4KEHoTPb32aS9QmSs44ZO+AJSY9IIFjXmKsOylEVqb+TjvBSeItrFSWSJbYrN/Yw ja08WEggsogEo/j1J2lJTzohUzPjPWcsZ4qn15u1UIU4wm3BC9gk0WcurS8gtEEHJcZf 20E0RPanWGJm5n/m0sUpOsJpmQcVkTg7PrbcXcMS/WIn1UISb4/RTVVH8NRjLTM4/BLP jlIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=2OFBhCh4RHntOGfrMM9Mb/L660rhN04lww8cpWSBi/E=; b=CiEWz0cY273GnHbIoBv7cXMyTGkb4GxNvAkdexCXU9ucpRPuhfjkpJZRcCbLfhWPtV OAgjwU51AtGjZa56FHM3wu1t96e1HJAuTIUSm757ScikG8XDqmg6UhVtMSqAtNPgE3x9 YVq4WS42m2P+CD23QFAyZEVv8u/ux5q4o/0WSCsuYGw++fynDGjs/TOsem6es7O0miWs FHaVOPEbemNLFsA8u16K4tAd7zjzCLLTixXiyLsPsGJuW36dgnaNA0MUD1VWAmHMBLo/ laFUC0FDEKTIdmR87mSnS09uijhFwh5Os4cmR+hZhfxuwA6LId0DHAyXZocZCUnvjR2X IMuw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ifooX0V5; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=2OFBhCh4RHntOGfrMM9Mb/L660rhN04lww8cpWSBi/E=; b=C1aMiMHKpJ2DpuVOhLQEJm2pGQiLU+elcdhbX5sbIkGfjtPHGTE2twz98w+kVmHtCo +ZrP0CRgXDE8KUx7vGClBNnpdo9yWAOuWAqllcC701eCLduscCy97jHJ8uBIWmTVxkZr UQmVRoZ4HKeNBmgxrLk+xT9mqETUQBWQvOR5A= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=2OFBhCh4RHntOGfrMM9Mb/L660rhN04lww8cpWSBi/E=; b=DrGRkrystG5BD9Oenog6mOmEZcE6wjT/2hyo9PZZxNvxYslFkyZyzecFK6lD5oA3xc eXaJL8IJWKGV/rcCnQzDkYe5DkZsG3P23Si7or7zCz55a+M0h5oo+zwoIWVDVo7V6H23 i469zgG7GJhFjzn2UqSBPkN6mRDVFfd/1g1dgRG4AnLdrPQDoKK1SuBcvqT56EXBDd2Q TUx0KWT8E9Xu/jcHEOvGe38aBln+EMi/EOZZO5u61QbtZDOcpbMvM1AY9/7G2oy/bJPp asSjpzFrf4aIjUsSJotdEQOyI4m28gaQhps3ippjSPb3RZtiQPPxLhJjEttesuK1BgO5 ATIA== X-Gm-Message-State: APjAAAWaDcZqYGN6L+tJ4JF7xItSgv8h1NuORItUq/5liNgby0pWmI7/ +cDrjuqPmuHexTj/DETo3kMixZHu X-Google-Smtp-Source: APXvYqz91xgt7zsVbEq6KZwokbRnPvwAv+37GmcME2F+PyD+m1Ldx0Pkxcsa7fgEVfD3GdCLnmVSLA== X-Received: by 2002:a63:bf0d:: with SMTP id v13mr32617404pgf.186.1556483373246; Sun, 28 Apr 2019 13:29:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:bd8a:: with SMTP id q10ls4215083pls.5.gmail; Sun, 28 Apr 2019 13:29:33 -0700 (PDT) X-Received: by 2002:a17:902:9693:: with SMTP id n19mr49823646plp.92.1556483372851; Sun, 28 Apr 2019 13:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483372; cv=none; d=google.com; s=arc-20160816; b=ZNyqJ82eqTYkzV1Q/5e+YJdBpWf4cmh0osh5qaT3bOAfw2lHLZ6YSIMGrHL4DbIJfa zcHsvQvdU/ZVu70QeSonjOOKqRp4aUjuHL7WF7IDYJVLoaUyVc9uW8zmuzpGs1fYNCy5 5C5AsDZslDqN/ElQv+fXUSeeydOeXTBY/TzidtRzCbqR0Cq4A1GJop64as+YYLDVxvgW BJvm3zU52uoEnOLaxhPo9mCN3qz6Xe0p2k00RCdVO135v6xkA+cZ7EG8/2/AyI2vVvmm sml7chgZu68C6JqtTlZPWcwe43RYA6OMNXPO8mqzrMc5L05+mLhyoXNQYH4WJC8R/Efb 3okA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=p2yOgWDOu2LU09nRm/oHIlXZTD47h62ToxLJhnnyR9E=; b=UGXR2HZeK1Miw5+fZE2fbtCAAkIip+pO7f1ED517MoEyPAvO6UYqjFEFtQ9wspnZtV ZhxW7XHU4MACLJhfAljcE/cjNkhAKZ1qvSNoaQxk5ciax1211+2C6AeHWyFW2wCsn66d YlvlHyjiuo6qzzhieUYoaHTXKfFBml/4oUsvnhxYxm5kVBqqdQZ/cAPKuCUjv9NLjr9H +bIMkKwSV63v5wg5D4D9lk1F8Fd5HfP+wITXpcj8qL6nRZdGIlZ96CRdpokjlb24iOh7 d/hQlbFBSNZVjYu/XPA4V0HYM2BTT1icTNyPvhvwGVJLkNqnWw74IS59kufbf8VnhE7i A6KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ifooX0V5; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 1sor31642597plz.0.2019.04.28.13.29.32 for (Google Transport Security); Sun, 28 Apr 2019 13:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:9a95:: with SMTP id w21mr58785332plp.74.1556483372584; Sun, 28 Apr 2019 13:29:32 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:32 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 11/19] spi: mpc8xxx: Reduce scope of loop variables Date: Mon, 29 Apr 2019 01:58:46 +0530 Message-Id: <20190428202854.8590-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ifooX0V5; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six The transmission loop starts with setting some variables, which are only used inside the loop. Reduce the scope to the loop to make the declaration and initialization of these variables coincide. In the case of char_size this also always initializes the variable immediately with the final value actually used in the loop (instead of the placeholder value 32). Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index a2e698ea17..2a0f3cc06a 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -88,10 +88,8 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, ulong flags) { spi8xxx_t *spi = &((immap_t *)(CONFIG_SYS_IMMR))->spi; - uint tmpdout, tmpdin, event; + u32 tmpdin; int num_blks = DIV_ROUND_UP(bitlen, 32); - int tm; - uchar char_size = 32; debug("%s: slave %u:%u dout %08X din %08X bitlen %u\n", __func__, slave->bus, slave->cs, *(uint *)dout, *(uint *)din, bitlen); @@ -104,8 +102,9 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, /* Handle data in 32-bit chunks */ while (num_blks--) { - tmpdout = 0; - char_size = (bitlen >= 32 ? 32 : bitlen); + int tm; + u32 tmpdout = 0; + uchar char_size = (bitlen >= 32 ? 32 : bitlen); /* Shift data so it's msb-justified */ tmpdout = *(u32 *)dout >> (32 - char_size); @@ -145,7 +144,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * The NE event must be read and cleared first */ for (tm = 0; tm < SPI_TIMEOUT; ++tm) { - event = in_be32(&spi->event); + u32 event = in_be32(&spi->event); bool have_ne = event & SPI_EV_NE; bool have_nf = event & SPI_EV_NF; From patchwork Sun Apr 28 20:28:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 328 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CB13C3F08F for ; Sun, 28 Apr 2019 22:29:36 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id z7sf6106406pgc.1 for ; Sun, 28 Apr 2019 13:29:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483375; cv=pass; d=google.com; s=arc-20160816; b=aoh4g7lOCqdf0mS7daV92sjdZG29110AQlK8wB9Xau7RQGyMmO4FpUwOcvFIdWhxE4 R3Kq+ao8OxP9xw+2Nv88x9+e7OoJ7Kt3WSKPmWatcozi03cSF5e6N8ISBet3SlyiBgGw nsDpokc8cLMUK/jnl8GZjLXY0CJcl+lsxzwiS00kFOBQgwAAK/UtBnBSFt3wCu0ibYyp 3iR78du/0CWjvAVuof85z8f5CjR1J1aSPDDCs6FfXBKSTmjxWHkp7EfxbsY39KpI1JKa dmGTuofnLm60c75DQxMR2Yyfg4bvU2yPCH8MIXRGleWCSr5ZjM/kiJPDdU2vCKXKUYK2 dbdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Q7y8ddimOcH0+DzW0LOrl56s5eF5cE0HvYvWBme78HM=; b=rp8E8iD0bOEBvLLC6tTghe7nJaevSlealWc/5MD5VyT15rpAuvdslXy9y+hvmRUPew S5icJUs1M5KLg5xzqe1MPck5cvOcCQhAeY+2O1PNlbV9YcuSNQucGY0x77dQdhNdnVXl 2g+zkYsvwlhPQAkeVNCWZe0Se9CJfycy7H7x0/YlYTNIgF6JwfntZzkGzCv1mvCl4obc c/++RCteAIkcnCT8JMsdyHxGVSLuba6hjeOphHGGnRgEMbnModCuKKovPmZotIiySSBG T9Ji9nuOT7W5ueH3lx/UgUccKUBW3r+7si0X+Fz8Rx8DUr488WfEbL9nInoXsJyHsFuo n+vw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Gj0/sgbw"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Q7y8ddimOcH0+DzW0LOrl56s5eF5cE0HvYvWBme78HM=; b=VmYIUQqQtAUrEswF4phJAmGpoDlriCkxlB1c1T9rSqL9zbeRM0wwOtwZAVvxvczuJ6 SebucXhtpcmwz0GgmeYn9V5R9GmdMi9/f58gBBw4/eyqWj7RgocOyg+uB+/k0aICzbI7 Lttej6hN0mwfCyczYOfKJ3fRjS0uKpBI+/Kl4= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=Q7y8ddimOcH0+DzW0LOrl56s5eF5cE0HvYvWBme78HM=; b=I+iDnuGQXfvmho4HS2zqi005ZYYLTCXl2/KMemsxB/kOQAH83PIV+J3ZE55jQhRBqw DmQYH8P5kzQnKtoDAsMssyxUn7G7VnzPmEcnhx5zxLR9LmWgW5IHATO/XiszGt7iSgko KFlIZpsRAhezIb7X8+ziGVh97PAu6Pkdsn1Rkzva5Wnj4mFwYScLZdb4thtNZ4PWn/BT kKLNYqDJzhAS8gr/CXEpWdgbPhOVIqA7/BSVbclj2rGhfGHsf29/cZYyT4Fw5jj0DUzb nkgq4+gTmXkHTk5731wn2Lr9RQRXPBxoPASkVa1qGTrZyIQMyUB5lsvZcr2SLQOnZfs9 lxEQ== X-Gm-Message-State: APjAAAUjMaHaZJTRfOhDyrqOTHT+INvFpFQU5OTWt6etTMer3ndjy054 +IBH241olyr56vNgiv/NJ0xud/1m X-Google-Smtp-Source: APXvYqyEvpGTKqIWfErSAk105Ws2QPrt8MiIbxFTXumoUGgR5SiaVL3YKrAx/poY8pzBRt19vvwqNA== X-Received: by 2002:a63:2b41:: with SMTP id r62mr55531073pgr.403.1556483375600; Sun, 28 Apr 2019 13:29:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:6b44:: with SMTP id g65ls551951pgc.8.gmail; Sun, 28 Apr 2019 13:29:35 -0700 (PDT) X-Received: by 2002:a63:2bc8:: with SMTP id r191mr19622776pgr.72.1556483375229; Sun, 28 Apr 2019 13:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483375; cv=none; d=google.com; s=arc-20160816; b=ioYdyG9+qNMFmBZNHw6MGqbtmivHx084QCsvhpdLB2f2um0jSKMoM2AACQAzy+xfXN pMumuB+ZeIbaPusFxHt3pxh4qZzDDmNUp699Lo6qd1IB3s2kdGwubDrNoWvmU01jY9J1 VzMJu8NFyeIN9r3njOvMIQdUowUO4MMJjAUB1ydUmb1/mXR/kxzKatgWdxI0DiLWLmBX 8R92AQNVPWWGzNNBmJ2kIoJA41aSfDtSysFwAiuDIdDvHkNL427hcl7WNu2mPzqB57J/ 55yN2F5gPKrGlCw8MrUrTZM/gOCHZwfhe/oTSmLDCMoZoAMyJC/p0GY500HDyZ+tzL+M 88pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=9z7Tvb7YtJKfwSMCWjYsme2ZetdCxq/rCgs8WiN4acI=; b=oVma+5HucZwiMdWHfFZEiHCUrhTfGxhEug2t3xUVmyujJyNjp7+B5nLyGEjbsUE2DQ wPqJMF+05HbAUy8qXa0ZIUrxGbw1w6SFBPxeqCuAhYyVe6NHnTwbjNI5/gzAf42M09ob U+WY4kWe24ybo7BuqBWpKVsmkQ26iwxxYT5H6Ifq3wtXWobpnSye4JLUM28HS3NzygB5 MJeMnyxr/orRGTMeDmZadsqlKSscVAnBaNb+EzVIGN5US5uBDTFFj43kt8y1bCIzL94h oAQbZ8pdFmRYyn/gSoJnoiwKGG+Ie76Tgw0TFdpsJrd02STvSWiqXPRfiC5gpPScnDDn 28ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Gj0/sgbw"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 3sor2582281pfa.24.2019.04.28.13.29.35 for (Google Transport Security); Sun, 28 Apr 2019 13:29:35 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aa7:8a92:: with SMTP id a18mr60052550pfc.218.1556483374949; Sun, 28 Apr 2019 13:29:34 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:34 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 12/19] spi: mpc8xxx: Make code more readable Date: Mon, 29 Apr 2019 01:58:47 +0530 Message-Id: <20190428202854.8590-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Gj0/sgbw"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Introduce the to_prescale_mod and set_char_len inline functions to make the code more readable. Note that the added "if (bitlen > 16)" check does not change the semantics of the current code, and hence only preserves the current error (this will be fixed in a later patch in the series). Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 2a0f3cc06a..83fd8b3cc1 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -30,6 +30,16 @@ enum { SPI_COM_LST = BIT(31 - 9), }; +static inline u32 to_prescale_mod(u32 val) +{ + return (min(val, (u32)15) << 16); +} + +static void set_char_len(spi8xxx_t *spi, u32 val) +{ + clrsetbits_be32(&spi->mode, SPI_MODE_LEN_MASK, (val << 20)); +} + #define SPI_TIMEOUT 1000 struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode) @@ -66,7 +76,7 @@ void spi_init(void) */ out_be32(&spi->mode, SPI_MODE_REV | SPI_MODE_MS | SPI_MODE_EN); /* Use SYSCLK / 8 (16.67MHz typ.) */ - clrsetbits_be32(&spi->mode, 0x000f0000, BIT(16)); + clrsetbits_be32(&spi->mode, SPI_MODE_PM_MASK, to_prescale_mod(1)); /* Clear all SPI events */ setbits_be32(&spi->event, 0xffffffff); /* Mask all SPI interrupts */ @@ -119,13 +129,14 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, clrbits_be32(&spi->mode, SPI_MODE_EN); - if (bitlen <= 4) { - clrsetbits_be32(&spi->mode, 0x00f00000, (3 << 20)); - } else if (bitlen <= 16) { - clrsetbits_be32(&spi->mode, 0x00f00000, - ((bitlen - 1) << 20)); - } else { - clrbits_be32(&spi->mode, 0x00f00000); + if (bitlen <= 4) + set_char_len(spi, 3); + else if (bitlen <= 16) + set_char_len(spi, bitlen - 1); + else + set_char_len(spi, 0); + + if (bitlen > 16) { /* Set up the next iteration if sending > 32 bits */ bitlen -= 32; dout += 4; From patchwork Sun Apr 28 20:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 329 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2DE993F08F for ; Sun, 28 Apr 2019 22:29:39 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id f7sf6119714pfd.7 for ; Sun, 28 Apr 2019 13:29:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483378; cv=pass; d=google.com; s=arc-20160816; b=ccOFBW9CdfGyovGsPs2UUDQiR57hEDUGcStPx1hnSe75OfnU1H1lcR1Bwvbh80XUIs YMX2j1JWYvbizKQLEQhkgsWt27pbvyZXr2aGS7AZjiphmLtM0QATvU45YQ5YFfiOXmVr fppc1ScFg+I3xGt5MzbXduPaFNSM/oQ4L7RCoQ0WR8OSi4CoJ2WuLLVvxIcVz6s/iv4+ pSv0p0vhe8eAfJAmU8WzID3gQ2xA+l9/Tau2TxpMRbdrBwMinjMnLCNJA5pWOSjyDJaz LD6gubgjIv6qH2HebkxzNumF7cW79HZ7UpT4HgsLkRj+AJnPuu7rFv9H+DCyUY9/Byzt tp4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=HFmj8iYFThgrrHhPeDBbQung1FQPYVWsozJnP62Ef5o=; b=tU/6bzuRQnCZjGSSrWHxGIKodMVJHpIBQ/oS40h846XeT8mdYBxAmFunqiGgCYPuNw j7JLAleRvQFYTVr9qO8qDbQM/IKJeP8x0/v6ozOteCWQgODxGIPFM7pD30Frml2R3P2L 5/tNRgEBU3CbRLAPS8aVpBKb8HF5AR0oPwv+E72wt6bAEkTTlA9v4wKGRg+pPgfdIICP YVt5A2jSHeXWrKMm3QJO7rxgzvZZDwtZYSDB3hR6DA1cUDkW8qTTNLgUXMnDJkiBpgxI kKdUuuOAbOuRf7TYOlOPW7rGCjW6kp7r6qsUFfoY4PVwdkT4/SV1SfQ7+DiB1MfMVDon AAAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PH9y7yF6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=HFmj8iYFThgrrHhPeDBbQung1FQPYVWsozJnP62Ef5o=; b=OtUfxSZ0qghmI91iE1756JW6x4x7hflU71/0Y2oA7mYEu7HZJqEltjjVrjrgWf/0rH xgeN534AVU3HZNGO9jGnT+uShf4wJAN5HZ/XLmA1a7a+FNlCLaaZylbgflFcQedjOhFz 8elRTtG+3ociNUP9JHNIFQvU8LLtr3UYu/+Hk= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=HFmj8iYFThgrrHhPeDBbQung1FQPYVWsozJnP62Ef5o=; b=HG35qbpxY9h/W/8Fn3UqKCfIJIpgaR9lSzk/C4FSg+P5KfwPtQtOk7ovtUO4/BmcIC SRuCkcAtROFkqefctcS9rgSaIHyP6qnpiLBuM5/DazcBNIpVijbVTI5QQX2Ky4xhF6jG 8mi7K9sUGEWEFZNT+7yl64TtlGBCYx2GntgstyKzvvY+jpBSkvUo514N3XMD8LyP81Lf c8+ONgwy9n4V1HOjyo2+n7lRzUpoRNfiVeQSTVLw4sOGbAdyrXwWe5nw9GKtjzRBXAOx suDwzdib3xpifJkacObvwAiq0hYo7eP1C4xKC+BoO6w49+QBuS9WN8pe/V++KvJV1zxU UNrA== X-Gm-Message-State: APjAAAXvnhbPlTqJXW/5KXtDnqlS2GeUcTjE+ugffjgb/2I458yZMmaQ NM+FjnLphQROkuazQ+AiBUzug6MB X-Google-Smtp-Source: APXvYqwY69Sp1j8KobmE3aP/96BNpXQGK8jC1P5S788tXIYBUVucNQod0vJxQQbtkkPsvrYW7JdMeA== X-Received: by 2002:a65:5549:: with SMTP id t9mr54891463pgr.388.1556483377993; Sun, 28 Apr 2019 13:29:37 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:56cb:: with SMTP id w11ls506349pgs.12.gmail; Sun, 28 Apr 2019 13:29:37 -0700 (PDT) X-Received: by 2002:a63:f444:: with SMTP id p4mr55556945pgk.32.1556483377618; Sun, 28 Apr 2019 13:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483377; cv=none; d=google.com; s=arc-20160816; b=BbavlgIYhqr9DiRiH3DUsCyQ2KV1eFhWCi9TvV4x4kEOefqYBiZS5WJIEjQozqL0WK Vkej1DD+FRi0eHrW2qPACCwDxMEyZPmhFwj20L90Ju7razPUE5kvMA8xi+yJLqqefap4 mjBT/7Ti7B2iFSzjj88EUjIyV1xtNWJSYfKJ6WV7NzWiwRbtkSupqeO7ln61LrxCBVcW cV0AHzJ5XbTm7o4lNBaZqBfYdiPu5fFSVdexpaehvSLzJc60zn/f4uLM/tR0g2/fsUr8 aB+iNxzudYW8vmgLbUtJ8WwlGTly3TFTr8YtntqfXElSeXx8dQoL9sYm/GlW+u1sd/1D CMmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DvxOHgjATfWl2XuOb3BuIsm23gd4oYcGplmjAwTQIp8=; b=o3KQ9wgpTgOJZOAy7N6HeXssBvz700fmQNVxBSHvGyDU7VyJTDJ6K9l0iFxZfn2O6p Dpj/Qm0GxxbwvW/U9QlGWt/4yeCnoAl8LHg9DGXaufCp7AXgGBGwAWNoEte/ouVtFfOE VoyxwtEHVSb80BVbefwVc3NTAsjvkEC0Cuf2RP3As2xesT4fMeUE/KPhqe8uphuZVVNr ijJrc9P5oNQOAm55fJuklJCxT9ZT0j7zgCHWzui4b8WhnbgVTIFW3hv2uFd4lAkD0h2P wk176k5lr5imItNqfPwvM71vrNINH3UMtiZ13QvUB7G7+PqnZmf/1rKWl/IXfqFLfutn xE4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PH9y7yF6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p2sor1782861plq.69.2019.04.28.13.29.37 for (Google Transport Security); Sun, 28 Apr 2019 13:29:37 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:6ac6:: with SMTP id i6mr58293518plt.313.1556483377368; Sun, 28 Apr 2019 13:29:37 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:36 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 13/19] spi: mpc8xxx: Rename variable Date: Mon, 29 Apr 2019 01:58:48 +0530 Message-Id: <20190428202854.8590-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PH9y7yF6; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six The variable "char_size" holds the number of bits to be transferred in the current loop iteration. A better name would be "xfer_bitlen", which we rename this variable to. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 83fd8b3cc1..63d956a295 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -114,10 +114,10 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, while (num_blks--) { int tm; u32 tmpdout = 0; - uchar char_size = (bitlen >= 32 ? 32 : bitlen); + uchar xfer_bitlen = (bitlen >= 32 ? 32 : bitlen); /* Shift data so it's msb-justified */ - tmpdout = *(u32 *)dout >> (32 - char_size); + tmpdout = *(u32 *)dout >> (32 - xfer_bitlen); /* The LEN field of the SPMODE register is set as follows: * @@ -165,8 +165,8 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, tmpdin = in_be32(&spi->rx); setbits_be32(&spi->event, SPI_EV_NE); - *(u32 *)din = (tmpdin << (32 - char_size)); - if (char_size == 32) { + *(u32 *)din = (tmpdin << (32 - xfer_bitlen)); + if (xfer_bitlen == 32) { /* Advance output buffer by 32 bits */ din += 4; } From patchwork Sun Apr 28 20:28:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 330 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C0FE73F08F for ; Sun, 28 Apr 2019 22:29:41 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id t5sf5349579pfh.21 for ; Sun, 28 Apr 2019 13:29:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483380; cv=pass; d=google.com; s=arc-20160816; b=Oy81BP8SlBqAPqhZVkDVUkP0UzDoHrGylflhBNAbqqEIsfqDEXuaviqrQzf0n3xYJz 7Choju1TlGRqMO4tFJGLsbgMWaE8v04TZR/c/969mfecTh+cnVA/aLH44eZ6ONUd66q+ MQ8IcQ4Ih3N2XtTxRB7MNoLxGruXotdchw0XUSt613+vdx1akkpyQQv+l3w05WU6Mw70 hoMVfqQmutgd/92imLI9EU3roY9CvuEDGbtiSPA9AVxz3PfNdrYcOIeHnO4cKUDJ505F cr4WzsNkMegifZNIpUJUO3IQRcDMskdPvHk3/9WJwIlfYhc1SXyVKIhnVyeFDEHsiIMD DGHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=UoByjMdJTaI7RjBVCsbm2AVb3QeNYnPSqxCP/NlIG5s=; b=nOHek5fxDMBgXrS2QSiKW3SmqjN4wftO+nb40c0C+hNyyhmNyo4tuiwGo7En4ZRMt2 XKTTlnrMeYSSFTtLbOXPoVEmAJQ+E/vacgLdB7gcuQOmgBIgxTRZJdONu52LJBIW2bH7 GcZfkYyH90XNbHfxbiZgjdCGAEib1M8FHE3blZbvFn5AauzY3a8++W5MEjsMFtK2qM6C Dvj8Aps8cy74GXP3Xz7zbHcyLGnC2qwypedUXNLZ31GtwloL1spo5AxKqblfG3OP0bMv HzayiGAWOjR4+ph1SDdpFQAhZ++w/Hix1FhmPxcc/7kq5wc129q9krLjH7XCuWFeVU5E 45Bw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MPqxGtQn; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=UoByjMdJTaI7RjBVCsbm2AVb3QeNYnPSqxCP/NlIG5s=; b=XBcz3jBWbCMlMn7MpUHa7X/yhXIp9vmpMvJbyBk6QHJV6YXYVgx6wSsl9GskMIT1wF oFJreHi2HkST3CBcTIksl+/WDnV1QYPhhY1LZPjMDToAl5EkVZt8Gk6rlz2wYLZGYYbO b5YblqsnEBVrHh5DEYKx1XYLWuRHaw+zpEiew= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=UoByjMdJTaI7RjBVCsbm2AVb3QeNYnPSqxCP/NlIG5s=; b=lEDQn5PBEElYgbtilbFi2zmuPVsIE10MnxSbFqRpLN8V+hCkbJCWVIriKddSI1aFXS iM38yR6FYcoxRLnwn5HAf7p8btHRXQ9zYHL1PiCbVoKFXc7mp3cV4MU1VyaHPBBaCnYC CrBxeNK6TIpZRQzmeiB/gonX3A0mfP3br6C44GL3GdGMuq97GDtxImocU8Pn3YbBtQzr inEmKaY4x3RM2Ac/SIG13DPEsek77zHsLqI75ku3Olt30CivyCnFZN/LS6YW4DCyWBH8 nDOpv/40VIO5P/nm3TnBt4cYdMLbjR39z11xq5etDenXSZY+nCl9N8C1mzdRjjsLEDNn 08yA== X-Gm-Message-State: APjAAAXhddaWzG1HXxNyzGXNDSBM7j0AEKZXvHW0q83d9ltxjmUhSPhz 5BiRm2Apoj8S5hL7mLO8/Ef8MgFC X-Google-Smtp-Source: APXvYqxOj+9FVzS+ncbDyUxZ3nf3H4ihjT1gXHCVbv0edOD3DFJvCLFuFoFFTvP2BhbwH/VpjWOGaQ== X-Received: by 2002:a62:2fc1:: with SMTP id v184mr27105712pfv.258.1556483380587; Sun, 28 Apr 2019 13:29:40 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:868e:: with SMTP id g14ls8389341plo.15.gmail; Sun, 28 Apr 2019 13:29:40 -0700 (PDT) X-Received: by 2002:a17:902:1024:: with SMTP id b33mr56725176pla.46.1556483380280; Sun, 28 Apr 2019 13:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483380; cv=none; d=google.com; s=arc-20160816; b=BEyZZno7kVM6GboWNrOqXg6n8SvDuxtZuVieIkmCNUxzOvoi/UPcGTM2L++4uEo8b+ cS8XfGP8URxBSivLNwXHVpQO9GCfDtoyX1EWm5zMq2zwsfruiBPRYE4VoAhOC0h8Ci2i OULG+zO9xY+PbL15/JFEmfnfPPI3wZN+ClcSsy0cIRYHIsqrK35i+AvMBJmLdy9Rfykk abcPN9hPuR2zHimyR/EMf+D2YU+FFygHqvcmgopZX4zsxg2C24DGZx9RGcORiRe5Cwvn +qoC1q67DXkTMm/wY8uY6x8sf8RWGkMJ3/4lh1/n9mcWR3MOPfbq5VxHPC7KGxrNKanI AoTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=5iUy/onrKyb2vM2ZlUwsLfl5EkxNlnANZNxhJT3G9LY=; b=0eq6cysmrVsP6N04Ad098CPh7us3l960Pt8JazLioDJ2v66Ro+7fIyvWtIGNl9wrJL wYoJNYr3u2uUPoRD3k6/+0nGq+gK3DA+ODm415HrbrsG4jNGAfcYLdclUXm8Td2qiOXg XYGD9qPvOVnmfvlkDGI7ILZU82IfA889jC+H0Ri/lUrXZo6NXwEDPx8YdRQ2+1PLcsR6 4hFfs2WbGqpPB94CG5iFYYlTlcpa8KFNNMKs2xdhYFsSwJbunveI1hoqqneMoBw44Fy/ DyZC9iLF0HnSOcIEjvXfjNuUI8uvPmPSWvhcvHmf3NxYUlWQ2b0byK/ZtfaOR7BfBCwY qqwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MPqxGtQn; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g18sor35345125pfi.1.2019.04.28.13.29.40 for (Google Transport Security); Sun, 28 Apr 2019 13:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:b40b:: with SMTP id h11mr57546179pfn.133.1556483379972; Sun, 28 Apr 2019 13:29:39 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:39 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 14/19] spi: mpc8xxx: Document LEN setting better Date: Mon, 29 Apr 2019 01:58:49 +0530 Message-Id: <20190428202854.8590-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MPqxGtQn; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Instead of having a table right before the code implementing the length setting for documentation, have inline comments for the if branches actually implementing the length setting described table's entries (which is readable thanks to the set_char_len function). Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 63d956a295..1dd5bd9799 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -119,21 +119,15 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, /* Shift data so it's msb-justified */ tmpdout = *(u32 *)dout >> (32 - xfer_bitlen); - /* The LEN field of the SPMODE register is set as follows: - * - * Bit length setting - * len <= 4 3 - * 4 < len <= 16 len - 1 - * len > 16 0 - */ - clrbits_be32(&spi->mode, SPI_MODE_EN); - if (bitlen <= 4) + /* Set up length for this transfer */ + + if (bitlen <= 4) /* 4 bits or less */ set_char_len(spi, 3); - else if (bitlen <= 16) + else if (bitlen <= 16) /* at most 16 bits */ set_char_len(spi, bitlen - 1); - else + else /* more than 16 bits -> full 32 bit transfer */ set_char_len(spi, 0); if (bitlen > 16) { From patchwork Sun Apr 28 20:28:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 331 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3C7F33F08F for ; Sun, 28 Apr 2019 22:29:44 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id d21sf6141441pfr.3 for ; Sun, 28 Apr 2019 13:29:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483383; cv=pass; d=google.com; s=arc-20160816; b=LBcOLK5Vnm2H7kDZhHcUSv+Dym6v+YEnhvFEGesjy/seibIXBYYtPbZ0nOSL6sh0HY fs7KHZJ9t4O7hC4sIY3NmMPLlrzzunxD+RHJkWN0cMoGxan0rudXmllwqUSF6dpNHbR2 dbH/IEX/g96fzz2eugovU7AR+x8nDopBwiidp6p/l74uPnhQpewuIBvo7lUPECczXakr rj6QqWe63PF9M313Btb/zuAIbLoWbhmLFnGfIuqW3KGmLwyUAfy6gdghPyGbM28YMpPi y2ceh9JPqFPvxz/roWBbRWIjKiV/FknGr/rhYsJNYKertsMQV6UD0RkTGtMhqVxLV14U 8m6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=j3VAK65cVmoFcuKjESxUDxtL/EZ9IETaYwB9ufA8+Nk=; b=yLXQc6BWyN1cXo590bURGkJpBGle6EdpAngLpIUoVdStjSs9rvWc0Zp6kgMy8THikK ARmzptPU1Tc9vbspWRkrio5BY7ARaXqMXvwZx/ZMNoaWZIMa7oPP9gfN+MNibXQzJopQ dqG+TcW8IcZwfZ7OcOIQ7pvNMWGHhoaknd4AkDZWKNGSliJWFI0YzwA+6f7SgDIh2rMh VomtZbwYjhF9g9EMSEmq/u6p9nDWz3QTKP1ufCtxT/ojJOIm22xsQTeVZQ2RScPx5Zzn 3+ZtK3mtGI6wnwv7BZFdTowic3v7vaVvR1O/3lLJHFfxEugUpi+bX9In05jFSj9bfz+t f1wg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HVDWAzPL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=j3VAK65cVmoFcuKjESxUDxtL/EZ9IETaYwB9ufA8+Nk=; b=f6B1UBPBeT9NFOPl3s5RF+1hht7mypKG40cGoyAF2SrTjNI8NyVbmb4I/Gw7WmpsdR fpWgrG2UxcTVwgWBglm1+IGTEBOlwxkECtjCgiJAWasAzJ4DDD1vlrtVdoAwVPaTG+75 PbPj+pToZFb1LLjaBDfTFQB8k8ocklaY/5Vas= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=j3VAK65cVmoFcuKjESxUDxtL/EZ9IETaYwB9ufA8+Nk=; b=B17CGgpEBXkWRQrgzJUNr0oxtZkTypzbZd2uZr8ckT64h47t9nAX85mkIFFVAdrS7t fmg9ZzQ4ByDiBdo3t8MGl4bg07NpNR4kmHF4tyRBoSIF0QVEriTBFq0Wm1UBDXUhP4Cb Di9p+BT7ZT91gB9n44yuopHLr0nwSoBKgBoH6xPXq9Y++P/qssWYcESwAoEQe4b/+1kt jLzCA6eabmRYfL0ZzayEPAsQrTXJMUti8K/SCYlfkW1etdhrh328J+94zzWlSiXZtnFK wVM+1ei+2Epd4k5MV8W5yaz5J+wtV5RS3nGQC24Zaupol9+d6RW0AWTPICxbMyykf+xO f6OQ== X-Gm-Message-State: APjAAAXYFJC+94GkjAKVDz6bNrG28S5wcYvoKLBnCQDaAB4ADlOLk3Z4 9jNF9jHXj7T6aUdP/CFpLPAZJh7g X-Google-Smtp-Source: APXvYqzePhzYWh8joo/Z0Q5mGpww64hUkGrEHfD7qf1+yAp18n2AG0/ttf7UFWdI/VILPOahm1PNZA== X-Received: by 2002:a63:4a5a:: with SMTP id j26mr52958277pgl.361.1556483383058; Sun, 28 Apr 2019 13:29:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:838f:: with SMTP id u15ls193448pfm.14.gmail; Sun, 28 Apr 2019 13:29:42 -0700 (PDT) X-Received: by 2002:a62:e90d:: with SMTP id j13mr18407574pfh.42.1556483382689; Sun, 28 Apr 2019 13:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483382; cv=none; d=google.com; s=arc-20160816; b=YleSQrcDMHI0m8TZB37z10FJi8ATMJgNI98HZYa2a7o/O2zPstRiij6xWJ7Yw+r5L1 Sj4XdeTxxGNq4SsK8DuZ21tkoUh0Doz7lUjrskYpcgDHMy4CEt73VE5K8QnnmGmUi0yg E/px7f/1W59sHAGZEUfM67enPjlrY446IExKz8S96YCWWyA1wydTNexAv5iL5ogY/qT1 TUdF4r+aKrlgoN8JaPsTpUUEFrFIWvE2T/Z14kA8Bji4BL9fNSqflfSW7oric7DBmcax qHO9JgHW7dOfh8MpH7P7tQ/vLwXP04usPRv1J5mSuRgBrSMRTz4Dvzs3JJWU/IvySC8i npfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Af0JQDkiw7NwHTMJnvOcv/QQFGgcR9xzFcMmqc8Aacs=; b=EJUG8gFM+JRnzgqF+qfnsNojUiXgiIsoH4ef37SWPhx3ft7OWcjJDjzOki1+zMDAJl WRAQvdhWeTkFGRVMdYfBk6sTIA9FOr63FWU0X6RzwsGiCg2wMl/2/jyLwLYoyEfUvIu6 0Y+NCL9dbaiS7VVssVn/i580klk2sJdtlcttNaM2kRArtZ86ILWGVXtuET7AwdCB2FD6 JH3QGbMQH5x8w9XNbRKToyMv3NbaZaVggzSUAm89CEu7c5fZpdZH63pmj2NYFmQq8Ah5 cqCZpaUMKkCiUcD2huKLV1tDPINVyx5r94fgy0ChQ8dj4sv9S9hJ+3HGnGaPd+ke9Aow 2u7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HVDWAzPL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i65sor1414948pfe.16.2019.04.28.13.29.42 for (Google Transport Security); Sun, 28 Apr 2019 13:29:42 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aa7:8e55:: with SMTP id d21mr9096991pfr.62.1556483382383; Sun, 28 Apr 2019 13:29:42 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:41 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 15/19] spi: mpc8xxx: Re-order transfer setup Date: Mon, 29 Apr 2019 01:58:50 +0530 Message-Id: <20190428202854.8590-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HVDWAzPL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Minize the time the adapter is disabled (via SPI_MODE_EN clearing/setting) to just the character length setting, and only set up the temporary data writing variable right before we need it, so there is a more clear distinction between setting up the SPI adapter, and setting up the data to be written. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 1dd5bd9799..1e7c0144c2 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -116,9 +116,6 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, u32 tmpdout = 0; uchar xfer_bitlen = (bitlen >= 32 ? 32 : bitlen); - /* Shift data so it's msb-justified */ - tmpdout = *(u32 *)dout >> (32 - xfer_bitlen); - clrbits_be32(&spi->mode, SPI_MODE_EN); /* Set up length for this transfer */ @@ -130,14 +127,17 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, else /* more than 16 bits -> full 32 bit transfer */ set_char_len(spi, 0); + setbits_be32(&spi->mode, SPI_MODE_EN); + + /* Shift data so it's msb-justified */ + tmpdout = *(u32 *)dout >> (32 - xfer_bitlen); + if (bitlen > 16) { /* Set up the next iteration if sending > 32 bits */ bitlen -= 32; dout += 4; } - setbits_be32(&spi->mode, SPI_MODE_EN); - /* Write the data out */ out_be32(&spi->tx, tmpdout); From patchwork Sun Apr 28 20:28:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 332 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8CC073F08F for ; Sun, 28 Apr 2019 22:29:46 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id e14sf6071766pgg.12 for ; Sun, 28 Apr 2019 13:29:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483385; cv=pass; d=google.com; s=arc-20160816; b=ay+Y5Cj9aXd3ZOCUNYGcg4KVZgs9ImRFkDK2zEjW9N7pygODij3bKlbtOvDILRfG0P riCwWitI82aoyIyoJC8CsPULIo27HR79LBmACpALak9BqW151jPHJNPFanHwmauBl8gY Fmk0/4KmfKT9zib8fFgxae+8vBRQMvTFOopI67Z1ofk7HAQdZVgclL9ok+L664Hl0qya 7nvhcwYCAO6qh43vuVVQJ6yHfB60xl4Did5hIxCaIBi0oZ9/BdW8j/JFIQ6b5fOigPeg zsoq1Jh9Xt+yVDrFXp2Y+jdR10xDjncwtCTpo5hIbrAtOvqC55aY4ir13idZabZlZkmQ 29lA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aEyHCEdb0p2Ye0lZALO5gPq7IPNfe6qmLpOdl7p7iNo=; b=KXE7mGqF8wnAG/25kDzGXJCfac94VAxv1lTQZ2MQXrbUhsIfax0ZUUUiRVPEvS/ynp 95CKP3Na/Nm0pd01jgieHWZKsp5uboBaNo4ARzAPzFmi3GPgEqjFBw0NhuBwogUwbbEz mhMBguYfUvySjkCoXixEriSxy6MdtoDVLmspycL4ThMkbcgar+uZ2JVYFCZDIbA4fmBB wYpPIo+Fyl4PS0P7qWJMUN8e5pI5spVq08u/Eg48qRSOXpBJl54XuBBvC2NX0kDIvvdW O3HPQ6Ztx4duLxDu9eM0uOJ+bn7hHtkMF4yKGqg1s/FjyMuxDqAGqjFoK2bFrjPhxFO7 tCYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Waoj0AbG; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=aEyHCEdb0p2Ye0lZALO5gPq7IPNfe6qmLpOdl7p7iNo=; b=OszTaZsxoHZI6rhSZHktuCYSSaz0HL6gROTbjVTVVyKda027/+b9ywj9IAHI8nZ0o2 lGbfYUvyZxsnBGSDxkQkM6A07pFcMd1DC1qXmQMHmmQcTDUd2h7XWYbt5KHomrI5lT3R Rfgvulwj6lxZqcT+k7zNpoc5IaSIgDT2+Ld6E= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=aEyHCEdb0p2Ye0lZALO5gPq7IPNfe6qmLpOdl7p7iNo=; b=cabs+mw2WBcdqfOFYfeydZMpg/bXjgDvgH3G2Et7UOqbOWRsdHE5+wGhYjpkynX54m FXG2qf5qXblE4peZ3K3l5BbxlaCX7Ejy1blPLRtacrRdE7GqbsUGcIeWnmpgYBgh634S HX/6jv4Vk6wKVNs6iKdhDrql36nHnuZ1UIAvde1EqzoCOV2IMgOXCvGqzWpwoToyHpdB Jm2ZTaHJi/Vu+fWXcaaSx9+UUHdYQxwLyDQPSaCAk5Pje1BneYQNFwQEORSyfUHdTvx3 JML93fQFMk9uQ9Juf5YU94o75UR7ZhE2xgsHKfHqe8HnEnNfBTGXkyRo62WuR7IrJn4m RNiA== X-Gm-Message-State: APjAAAXq0D4HcZzZrb9OTCHNARf08UuvJciE7ks7fmH4Yw25PJh1Rzrx kEJC7fRXvLbhvDp7qFxOg9gvmitF X-Google-Smtp-Source: APXvYqxLA9LFdKpALqcFkCoGyaYsLs/4CY8IZhWvrSdvwJblYowB5HlEEr8j4ZImdcsQ06HvVXO1Aw== X-Received: by 2002:a63:521c:: with SMTP id g28mr54859437pgb.431.1556483385373; Sun, 28 Apr 2019 13:29:45 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:8287:: with SMTP id s7ls38205pfm.7.gmail; Sun, 28 Apr 2019 13:29:45 -0700 (PDT) X-Received: by 2002:a62:ed16:: with SMTP id u22mr58501143pfh.47.1556483385005; Sun, 28 Apr 2019 13:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483385; cv=none; d=google.com; s=arc-20160816; b=fRLlgaG0QB/ZC/gl4NTplGfJ96P66zayf3ufsBs52I2oIW65vNubRLxCTG7RV7Kldv bgRFdmzbXhaSwAAs7oCJTysd8Gx4Rx38iNiwQteaq+klTmUIxFOUeS1MxEwsn9mymvJe 7XaNKcyYtNm/lAGFWMSjj1XVgkHluT8iCXOCosbicYRbCkFSyTnBMcL83xM4lHdH8fj6 y8FcUVLU5XSu4PZWbzYgXRozCFZHblDcOAvg8LjEJjOWkQBGGcatj+E8BwVU/rc9FHyN sViU0HDuNn/Lgz+7f/zFswcNdIikpOuyVgNa8Xq35ScWx9t7Z8yIwWSWKKn+oBLXcsVp K45Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=duQcG3hEbT6ithd7O9rAGFAiDOa0nOfhdjNb0drRc+E=; b=uSM8pK08ehA26U1S8vW+GDSBB9MhuEqJK6pYG77nnf36uFwvzTpjN17OdRzy1H8iZQ yKq8FAwT/zJ4fXS2k+/I+Uq8UtkMzoByEml1jnL1jhjs3mfBCdX/mNcHAZIXgWH5XZEg YxTdWUIEdDbGINLth9Oyn0DsAi+F7GiQeQGmwmI7/80aqsXyD9l9gz3AlQI1DiJ3VI1S b8pALU/JNQ8My31kA/e5uOWG2jjfOe+S0CYEfNwdj0RtEerGBGDN8GHTER7cGrgE4LxV reYPeCnj/SFvbi/6ktn+hRS1FxrUm1SzLRbc8QRU/JlWj8U8oyhdH8NQ+TZ64QNHsYhy xp0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Waoj0AbG; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 30sor28934076pgo.39.2019.04.28.13.29.44 for (Google Transport Security); Sun, 28 Apr 2019 13:29:44 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a65:644e:: with SMTP id s14mr2431391pgv.290.1556483384743; Sun, 28 Apr 2019 13:29:44 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:44 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 16/19] spi: mpc8xxx: Fix if check Date: Mon, 29 Apr 2019 01:58:51 +0530 Message-Id: <20190428202854.8590-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Waoj0AbG; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six Decreasing the bit length and increasing the write data pointer should be done when there are more than 32 bit of data, not 16 bit. This did not produce incorrect behavior, because the only time where the two checks produce different outcomes is the case of 16 < bitlen < 32, and in this case the subsequent transmission is the last one regardless, hence the additional bit length decrease and write data pointer increase has no effect anyway. Still, the correct check is the check for "bitlen > 32", so correct this behavior. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 1e7c0144c2..e09e91c8e9 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -132,7 +132,7 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, /* Shift data so it's msb-justified */ tmpdout = *(u32 *)dout >> (32 - xfer_bitlen); - if (bitlen > 16) { + if (bitlen > 32) { /* Set up the next iteration if sending > 32 bits */ bitlen -= 32; dout += 4; From patchwork Sun Apr 28 20:28:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 333 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E6F923F08F for ; Sun, 28 Apr 2019 22:29:48 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id o8sf6097862pgq.5 for ; Sun, 28 Apr 2019 13:29:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483387; cv=pass; d=google.com; s=arc-20160816; b=fhfUNbb6PLStGqpor0UMn4fRfuo78ZZhR1NxGUsd+TBV1AYCeEvuNVbg2DCJb1d5C1 yEU/SFNkgV8m+TUoFOsdmDEXoTZ+PCun6gLR+bBhRsT2QTXnKAOmf4ea3Bxs3rZorVPa F0C2iup7Ht68UTbwJi5m+/WMmqamzhJBL+uoUcCO1QoRNGlAwnf8myfywLRxFE4BA67r kDb8Wmf821yGr4vV5inpBoXz2U5bzeVLF7esmaeQ9FHRmzblp8R9sD5dlhxuKxlOdmLB +xmE0+XC0mD+cGwWDuYnh9E8xyQn/cvdAyrnD/Ui8HYxMC5C+3yRMzwgGbvRa8B250x8 xA7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=uoWq0YdPUoaAovXS66Bg5KEflTmjnJYWLCUb76LCFgo=; b=yN1K+TgPk+ZaU7Lje+EQOru4Ohlxvq9Pd8TxLWR/ognBwkUTEftf07qn2RAWwhgGBt h7TYRKHn7/sed/kbHmuRYaSxtUk827W93B9bK1gGf5DUTu8lki/6aistc0XsRFXTZAsR LNVevTADaQspyynwa9Q3JWOxbNdZ8Uu4ztieLyNeRwZaMVMEq0kBrT7m9ItooR+gor2h ViD8PYZX4SlB8fiFz05MeyNXul/Qs1DO5TMRbRI3dWyIFebq7rTYLNmLREssPVrAaIeg Kl8FrcxTL13AkcQyTaIhEaKEo0BsRte8v/er33Xp1MTuDR7vJQySSbKiWIJeMPhgEWaP 55Bg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XDafTVZc; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=uoWq0YdPUoaAovXS66Bg5KEflTmjnJYWLCUb76LCFgo=; b=b4TqAD63wM2hcoCm/L6g+0qgrA95WQGdxVrblN3+jHbXjGMG6mvBwQ8M8TBEErq8du 4YNnPumxCBuV6QgWl58o5mDlwSUDWsui4PwcjivJ/swXTkh/3TGtNsLHo1LwFZcWcTbx Z1vaOjTGSv7h+ks4Nq/n5hshRltlHEoqU62fI= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=uoWq0YdPUoaAovXS66Bg5KEflTmjnJYWLCUb76LCFgo=; b=fo4y5+krLX20vHyG21ghxH+7mKTkQtZ+Z4tr1Swh7/bdadPu5QniCslIArnw5FAfCK 7od3t2sUOafHetizv2FQhHU0jx7UXaf5uG+OCwqLYYH0EqYzYAiI/WH98NZ6JSiQa8Dy KxTFN1RlPx/S9Bg16kdJ1PEXDXgpsR1UpmXvTbIbqCS/5aQqdL07FLVutzNQ4bZgT5Xl qsRjZUi+B2qT4KqjMMrL/4DIFWFtp3NIHVjXCWmAPeXqw4sRHjkuIC1hDydmKYpLhrxj LToLcwRr8CGeh6etgrtIG/Pvsy1xzIcgZajT/8yFc4KNX6oJKTE7Ay+6SQRqDORBgQDO MkWg== X-Gm-Message-State: APjAAAUYTZccYM/qi30OYogg3F1JrjHKv4ZeDRCaV0HFP5DxobMnnMWD cWfINdUHTEY+7Cj6XwroXQPY3veQ X-Google-Smtp-Source: APXvYqwHth8Jx9d0BcceF1mQJl3zVfj+7hs/28bRqk+xT9kfYZ0c69lTOkF97mXVRCUaoLxByIMw2Q== X-Received: by 2002:a63:2325:: with SMTP id j37mr1132584pgj.137.1556483387754; Sun, 28 Apr 2019 13:29:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:c542:: with SMTP id g2ls127212pgd.9.gmail; Sun, 28 Apr 2019 13:29:47 -0700 (PDT) X-Received: by 2002:a62:5a42:: with SMTP id o63mr61704546pfb.170.1556483387367; Sun, 28 Apr 2019 13:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483387; cv=none; d=google.com; s=arc-20160816; b=p9hRJxKvP7A+XPRAKJ6zt1dI9KIevExkl3/IqX0YilVbywuVd7gOJd+IuJJn+N6wpH Cxupl9wv9qfG30Q+BxX1uGMB0913NCcEF7mNr4YwXq9E6gGELcrNEb2ltbR+wLFpdCYQ iZ849XxbiYXpMtq3GHJ/9GowYMSsMVWGcCzt8syk/KanAzKBCa6hn1+ccPbHxNAtoLY0 hnxoSdOC6kLi2yd/i/vQ/70kZKRkZrRo3kYoU3Rb0X+95TOYG6TKVwsVXRHkMJWgXfJs gC2/mzr81DmmC2k0jtAbdCveSJWUxsRKEHHZa1PrSgqVKgSn8z6sbc3kxvRbt+utpO0I ermA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=IgaR4FUCQnO0Df8jzFpeiy0ayqG5b2rwTivOAhw7crw=; b=XcFxwVs+52wog5pusYYGPE7sg44YvQdb2TNAq3Wg+vsUCaG1wOt8e3CdzenNQDnt+N ovjYq2jN3bkVd7w2Pwepho8ZcdWr/mU6pZvA4TQMde5Q5IpfI0yjCtzkOySSisOAfuGM ONt0juZiVId/FqBQpAjwhhO+a5cbVslfga3fqdc+e6k2KVOlAOWuxBj5vn3JuqxrenVr dMr/96jNBzB6C4nbFy6bFgMKE/JI2dBpbvQ/4ZH9J/FSj3pibzA4z3alPy6TwxkaDKnf XxsL7LzVQ55Yert9V+dx41qqK7/Tjm0jnUcH8geH7kdOof2CxV9ikDCxE7US/Y9bqqQy 1+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XDafTVZc; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id r18sor6833296pgk.12.2019.04.28.13.29.47 for (Google Transport Security); Sun, 28 Apr 2019 13:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:d016:: with SMTP id z22mr1569291pgf.116.1556483387084; Sun, 28 Apr 2019 13:29:47 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:46 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Mario Six Subject: [PATCH v2 17/19] spi: mpc8xxx: Use get_timer Date: Mon, 29 Apr 2019 01:58:52 +0530 Message-Id: <20190428202854.8590-18-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XDafTVZc; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mario Six The comment before the transmission loop in conjunction with the definition of SPI_TIMEOUT as 1000 implies that the loop is supposed to have a timeout value of 1000 ms. But since there is no mdelay(1) or similar in the loop body, the loop just runs 1000 times, without regard for the time elapsed. To correct this, use the standard get_timer functionality to properly time out the loop after 1000 ms. Signed-off-by: Mario Six --- drivers/spi/mpc8xxx_spi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index e09e91c8e9..63e1a150f8 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -112,9 +112,9 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, /* Handle data in 32-bit chunks */ while (num_blks--) { - int tm; u32 tmpdout = 0; uchar xfer_bitlen = (bitlen >= 32 ? 32 : bitlen); + ulong start; clrbits_be32(&spi->mode, SPI_MODE_EN); @@ -148,7 +148,8 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, * or time out (1 second = 1000 ms) * The NE event must be read and cleared first */ - for (tm = 0; tm < SPI_TIMEOUT; ++tm) { + start = get_timer(0); + do { u32 event = in_be32(&spi->event); bool have_ne = event & SPI_EV_NE; bool have_nf = event & SPI_EV_NF; @@ -173,9 +174,11 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, */ if (have_nf) break; - } - if (tm >= SPI_TIMEOUT) + mdelay(1); + } while (get_timer(start) < SPI_TIMEOUT); + + if (get_timer(start) >= SPI_TIMEOUT) debug("*** %s: Time out during SPI transfer\n", __func__); From patchwork Sun Apr 28 20:28:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 334 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 808F13F08F for ; Sun, 28 Apr 2019 22:29:51 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id i23sf6144890pfa.0 for ; Sun, 28 Apr 2019 13:29:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483390; cv=pass; d=google.com; s=arc-20160816; b=dZoTboS/6xVXFhm/zxicTAu9JS0+hZTtH6f3VWsxM3dEZv5HIeckBXloSYA7yMlZBr LNjErxyirLAUGUDQgmjFy/qq2wYfEjTzU0xTEpwYjZ/8QuRCVX4IgsvQMT3gg4HtnYqC ioGzWNbNafdesnQF9VwAQ7u3P7N3DeHgcUcgQRpvLiMazv995MOsf9cVGLsp67peh95b 7lVWeMrAPWyZoeFnxqx3ey8shynBffnczEPTiosg3wKbQKtsX5uu3Izy1yK4wSH8E0e0 iXOBQdRATxJIEyw6z5EEjVbVpaKFk95oAfxkT1hXvLFH7poxBfsB1AU7lgmTKkHCn+ls znLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=bfP0/paytEdh2UQwvwobmnMSLuilPn76ORNKNylBbDU=; b=DoMYaVSQUykIC6xhMY6FSF9kjdEPuEBQAVgyilY8Ge00BEadISy3k3/WDkJ8k8mQAU PSiUO716d9y1Rdstm+Na+K93Txs1JcmKQX0j39ecSEN4Lg/9Cd5io9JJ8Eeb4C5wai+p k/01FuHAICPpCoUCK8wW1Ex0CC4xXArBsw+8zdW/Gu5jOFTaIriXyliOQ4hRBiSH867h oWMyqdqOuP+NG60xrbXa5sitL7gSsYj3Tx9NLsuk202a7MH+2drtTcRTeUSoovItWwus QYjZbE+IF2lHDbxfst5Hw1+VPy5XGOKLLK1mEYX/UGOy9BCCXsWy4J4ur0SJ8CRvLmhx cx5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=N1h6NeEa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=bfP0/paytEdh2UQwvwobmnMSLuilPn76ORNKNylBbDU=; b=KHgaGweSJj8qgpPvPuyErCVRc7cOqKc4WujkuKe+Kz6q9LH8yitks0kWJkT3+6ID57 E4ephDQ9xdSpGW9uOMx6l29dmhCGi1Ut4FUwbeMWX8aejBwLO3/hCFzpK2ijgBMMyIeN Gn8v1kqBWETARSusFgsDEmlAuINtjeafv09bc= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=bfP0/paytEdh2UQwvwobmnMSLuilPn76ORNKNylBbDU=; b=GfzJHEABTUcnJBiCyDZwTgjEjXiDXUEkZ0Ne4o6ARGaWG+l1iik1VtMXcisf2zTzzV MwWbKyoN+9ZzxQ6ztfK76JpDOhNsgF1t7yBDyrtAtTziZ9UBJDrk/TQfN9+p8utWKgYY rePkY3K/RXbVvZxHhYD9gV2nTYX9XoHBp/qfBwHQzCop7ScDCk3SJaahuyQArzTSFYnn V5FjQJ15xBj5pU6p+68IddguQcXqBedPiGkfwEYH9RlpC5nffBPnnXmCGBHjIG/XrXUZ DXK2TCIBvNiaOYratHROBkWxfgSsPOx57e7APb1GkAjYIWX+fOM/uIm7ETczkJt1d4Po yoJg== X-Gm-Message-State: APjAAAVaIZvzVhVOWl9XnXUz9jMIo8nlr4XvW7w1CIzH4sifverxpDJj Jzks+LYgIfWNOtBOzAqMeIoiHKUL X-Google-Smtp-Source: APXvYqyUEKZZyPwkOjjZLzs3yECBMhyIBftTGT1p37qZ4xc8p+27qND6XZ/Z8ypmkygCgZs17Jv4qw== X-Received: by 2002:a63:6604:: with SMTP id a4mr23316487pgc.104.1556483390320; Sun, 28 Apr 2019 13:29:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9f86:: with SMTP id g6ls8388345plq.3.gmail; Sun, 28 Apr 2019 13:29:50 -0700 (PDT) X-Received: by 2002:a17:902:86:: with SMTP id a6mr57642821pla.277.1556483389951; Sun, 28 Apr 2019 13:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483389; cv=none; d=google.com; s=arc-20160816; b=MTLab98tnlo+Q2tCr6QHA/u30AsDkKCQlMKUZWTxYDUJDIsdqND8qLie4iHzuHrvUi WLsPP73FU2tbjoVqs+KkUfMgoXpqryPLry0Twp/lykcMzRyHICmZcz+n29w7wdqaydoj 1VTOMxGLv4VH2tmXksy675nMByWzOfqUWNGiuI9uKeebpl80YxZIE4uoKkwvF6j/ZuWz 12/i08q+uA8zpbnLi4zYkTdo1IYMior16xiFD14pb3c9YPsCJIvDZqGw5OHTlnf7PgH7 edUv7ZsDIkdB/sY4O3FanNZJYdoWaAnbP/dN4RCc9WgdjcX4vFSkHaGo8r1R3R6OYDxx I8wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=VjHrEClNEEFz6xuzS8rY93E6SfSRBp015JRdcaSLA+g=; b=ITCMzctA5rmAlPcieUiyujOxb2vc7eAsZG41UNhis3C1SuZa1olGbt1cjxCPEvZD4K svBHRZlHb2WPtCtfhnhldNBmTxEPNN8cCcdNDvgVZXqb2/xWJJEg1I8PqJ+gzidphxS8 bcWrMjVjBaiayL9aZTurKHOCbWyiG8BnVr6P6H1+nkd2yR8VSYmJfVvn5a8JF1vxyVOe T9ikpSPHRrMEVKiCT494b10VIR9As23Wz8gzXH1k0qqfRBi6HwIAqROzwHwrVy9jlaOj xCNscupmFXrPW2cxiJjOrcgv9rRFRgZVj74dOQoIxkiE6ajRHZ8Dzjst8GX48BW/a2vM k72Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=N1h6NeEa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l10sor6701445pgp.56.2019.04.28.13.29.49 for (Google Transport Security); Sun, 28 Apr 2019 13:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a65:4185:: with SMTP id a5mr54988688pgq.82.1556483389620; Sun, 28 Apr 2019 13:29:49 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:49 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Mario Six Subject: [PATCH v2 18/19] spi: mpc8xxx: Convert to DM Date: Mon, 29 Apr 2019 01:58:53 +0530 Message-Id: <20190428202854.8590-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=N1h6NeEa; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Support DM in the MPC8xxx SPI driver, and remove the legacy SPI interface. Signed-off-by: Mario Six Signed-off-by: Jagan Teki --- drivers/spi/Kconfig | 10 +-- drivers/spi/mpc8xxx_spi.c | 144 ++++++++++++++++++++++++++++---------- 2 files changed, 112 insertions(+), 42 deletions(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index fb794adae7..e196f64e2f 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -131,6 +131,11 @@ config MPC8XX_SPI help Enable support for SPI on MPC8XX +config MPC8XXX_SPI + bool "MPC8XXX SPI Driver" + help + Enable support for SPI on the MPC8XXX PowerPC SoCs. + config MT7621_SPI bool "MediaTek MT7621 SPI driver" depends on ARCH_MT7620 @@ -364,11 +369,6 @@ config LPC32XX_SSP help Enable support for SPI on LPC32xx -config MPC8XXX_SPI - bool "MPC8XXX SPI Driver" - help - Enable support for SPI on the MPC8XXX PowerPC SoCs. - config MXC_SPI bool "MXC SPI Driver" help diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c index 63e1a150f8..1c7bf10f91 100644 --- a/drivers/spi/mpc8xxx_spi.c +++ b/drivers/spi/mpc8xxx_spi.c @@ -5,10 +5,12 @@ */ #include - +#include +#include #include #include #include +#include enum { SPI_EV_NE = BIT(31 - 22), /* Receiver Not Empty */ @@ -30,6 +32,12 @@ enum { SPI_COM_LST = BIT(31 - 9), }; +struct mpc8xxx_priv { + spi8xxx_t *spi; + struct gpio_desc gpios[16]; + int max_cs; +}; + static inline u32 to_prescale_mod(u32 val) { return (min(val, (u32)15) << 16); @@ -42,70 +50,90 @@ static void set_char_len(spi8xxx_t *spi, u32 val) #define SPI_TIMEOUT 1000 -struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode) +static int __spi_set_speed(spi8xxx_t *spi, uint speed) { - struct spi_slave *slave; + /* TODO(mario.six@gdsys.cc): This only ever sets one fixed speed */ - if (!spi_cs_is_valid(bus, cs)) - return NULL; - - slave = spi_alloc_slave_base(bus, cs); - if (!slave) - return NULL; - - /* - * TODO: Some of the code in spi_init() should probably move - * here, or into spi_claim_bus() below. - */ + /* Use SYSCLK / 8 (16.67MHz typ.) */ + clrsetbits_be32(&spi->mode, SPI_MODE_PM_MASK, to_prescale_mod(1)); - return slave; + return 0; } -void spi_free_slave(struct spi_slave *slave) +static int mpc8xxx_spi_ofdata_to_platdata(struct udevice *dev) { - free(slave); + struct mpc8xxx_priv *priv = dev_get_priv(dev); + int ret; + + priv->spi = (spi8xxx_t *)dev_read_addr(dev); + + /* TODO(mario.six@gdsys.cc): Read clock and save the value */ + + ret = gpio_request_list_by_name(dev, "gpios", priv->gpios, + ARRAY_SIZE(priv->gpios), GPIOD_IS_OUT | GPIOD_ACTIVE_LOW); + if (ret < 0) + return -EINVAL; + + priv->max_cs = ret; + + return 0; } -void spi_init(void) +static int mpc8xxx_spi_probe(struct udevice *dev) { - spi8xxx_t *spi = &((immap_t *)(CONFIG_SYS_IMMR))->spi; + struct mpc8xxx_priv *priv = dev_get_priv(dev); /* * SPI pins on the MPC83xx are not muxed, so all we do is initialize * some registers */ - out_be32(&spi->mode, SPI_MODE_REV | SPI_MODE_MS | SPI_MODE_EN); - /* Use SYSCLK / 8 (16.67MHz typ.) */ - clrsetbits_be32(&spi->mode, SPI_MODE_PM_MASK, to_prescale_mod(1)); + out_be32(&priv->spi->mode, SPI_MODE_REV | SPI_MODE_MS | SPI_MODE_EN); + + __spi_set_speed(priv->spi, 16666667); + /* Clear all SPI events */ - setbits_be32(&spi->event, 0xffffffff); + setbits_be32(&priv->spi->event, 0xffffffff); /* Mask all SPI interrupts */ - clrbits_be32(&spi->mask, 0xffffffff); + clrbits_be32(&priv->spi->mask, 0xffffffff); /* LST bit doesn't do anything, so disregard */ - out_be32(&spi->com, 0); + out_be32(&priv->spi->com, 0); + + return 0; } -int spi_claim_bus(struct spi_slave *slave) +static void mpc8xxx_spi_cs_activate(struct udevice *dev) { - return 0; + struct mpc8xxx_priv *priv = dev_get_priv(dev->parent); + struct dm_spi_slave_platdata *platdata = dev_get_parent_platdata(dev); + + dm_gpio_set_dir_flags(&priv->gpios[platdata->cs], GPIOD_IS_OUT); + dm_gpio_set_value(&priv->gpios[platdata->cs], 0); } -void spi_release_bus(struct spi_slave *slave) +static void mpc8xxx_spi_cs_deactivate(struct udevice *dev) { + struct mpc8xxx_priv *priv = dev_get_priv(dev->parent); + struct dm_spi_slave_platdata *platdata = dev_get_parent_platdata(dev); + + dm_gpio_set_dir_flags(&priv->gpios[platdata->cs], GPIOD_IS_OUT); + dm_gpio_set_value(&priv->gpios[platdata->cs], 1); } -int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, - ulong flags) +static int mpc8xxx_spi_xfer(struct udevice *dev, uint bitlen, + const void *dout, void *din, ulong flags) { - spi8xxx_t *spi = &((immap_t *)(CONFIG_SYS_IMMR))->spi; - u32 tmpdin; + struct udevice *bus = dev->parent; + struct mpc8xxx_priv *priv = dev_get_priv(bus); + spi8xxx_t *spi = priv->spi; + struct dm_spi_slave_platdata *platdata = dev_get_parent_platdata(dev); + u32 tmpdin = 0; int num_blks = DIV_ROUND_UP(bitlen, 32); - debug("%s: slave %u:%u dout %08X din %08X bitlen %u\n", __func__, - slave->bus, slave->cs, *(uint *)dout, *(uint *)din, bitlen); + debug("%s: slave %s:%u dout %08X din %08X bitlen %u\n", __func__, + bus->name, platdata->cs, *(uint *)dout, *(uint *)din, bitlen); if (flags & SPI_XFER_BEGIN) - spi_cs_activate(slave); + mpc8xxx_spi_cs_activate(dev); /* Clear all SPI events */ setbits_be32(&spi->event, 0xffffffff); @@ -178,15 +206,57 @@ int spi_xfer(struct spi_slave *slave, uint bitlen, const void *dout, void *din, mdelay(1); } while (get_timer(start) < SPI_TIMEOUT); - if (get_timer(start) >= SPI_TIMEOUT) + if (get_timer(start) >= SPI_TIMEOUT) { debug("*** %s: Time out during SPI transfer\n", __func__); + return -ETIMEDOUT; + } debug("*** %s: transfer ended. Value=%08x\n", __func__, tmpdin); } if (flags & SPI_XFER_END) - spi_cs_deactivate(slave); + mpc8xxx_spi_cs_deactivate(dev); + + return 0; +} + +static int mpc8xxx_spi_set_speed(struct udevice *dev, uint speed) +{ + struct mpc8xxx_priv *priv = dev_get_priv(dev); + + return __spi_set_speed(priv->spi, speed); +} +static int mpc8xxx_spi_set_mode(struct udevice *dev, uint mode) +{ + /* TODO(mario.six@gdsys.cc): Using SPI_CPHA (for clock phase) and + * SPI_CPOL (for clock polarity) should work + */ return 0; } + +static const struct dm_spi_ops mpc8xxx_spi_ops = { + .xfer = mpc8xxx_spi_xfer, + .set_speed = mpc8xxx_spi_set_speed, + .set_mode = mpc8xxx_spi_set_mode, + /* + * cs_info is not needed, since we require all chip selects to be + * in the device tree explicitly + */ +}; + +static const struct udevice_id mpc8xxx_spi_ids[] = { + { .compatible = "fsl,spi" }, + { } +}; + +U_BOOT_DRIVER(mpc8xxx_spi) = { + .name = "mpc8xxx_spi", + .id = UCLASS_SPI, + .of_match = mpc8xxx_spi_ids, + .ops = &mpc8xxx_spi_ops, + .ofdata_to_platdata = mpc8xxx_spi_ofdata_to_platdata, + .probe = mpc8xxx_spi_probe, + .priv_auto_alloc_size = sizeof(struct mpc8xxx_priv), +}; From patchwork Sun Apr 28 20:28:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 335 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B0C5C3F08F for ; Sun, 28 Apr 2019 22:29:53 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id l13sf6105778pgp.3 for ; Sun, 28 Apr 2019 13:29:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556483392; cv=pass; d=google.com; s=arc-20160816; b=zrKd40DLH1S+pECN8Ra7lKC1IY8XEdqldv7z9libe7LWiOb2Eq42GAiPJPPo/y38Us y6eDuBG0J8ABdMGy1fASd0gMTE1LmHfKfE1YlmIOddg+sdZ59Vm+jEaqhsl8DQ1108qJ wadY7n6/mR+8DeQNF1tljkcSTXZ0JSCdRp+UIQH82TC2ILH3Ilk5nYzo28KzrLJjPS3J lR60sK6XFuQ6Ls3i9ZOKtLdZu1IvlE6hs8NOPHmHOn3IQ8TLj71zB5XboEXjCCBccFlV B1QL6V2xBfXX4W0LYohewU9SPTgUqDzls6FmfFmNYthJkd8Q9q1AfMeVrv+/1808DRpz m2nA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=FQm6t4lf/MhGommKzbaN/rLIk4K8mYvK+k8Qth1o19Q=; b=Ju3wIuhwSbYNVe4VLulG2tHO1yedfiJMqVmYq+JNQNKaWU4xQ9bdixbAkaXS39nT5B RNh7pwhG2eMhSFc8ATXNE7voX4cPIF/cxQltVnqHGstWjeQaBMLNKGyckCcTAedSqlZm 2+hzhWJ2SNdcU8JdfNiUBpmuaCRX98uPW4FAwLl2Sbv4GLdgc32iVgDm/3Z/ifG4FF+7 RvoscTJ762oMENyD3WNH+5PU4WoizIX7QCDXFIdiHhG2cPdq6L+NQ3qCpIlH9ew4UnMy A59oo58lKNwaxec9H41ZvXxczIrQdrXJunfDlhiS4LIdq3ZG39Pe7nTrHWL7OxiTPcPU argQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RTF7rLoy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=FQm6t4lf/MhGommKzbaN/rLIk4K8mYvK+k8Qth1o19Q=; b=iggKy9sUzNnlnBAFV/eaFDAV+YrhWQLVZlRb4lDEHoweqeZ7WIaWCJKCchJv4T2/L4 2A/n8WwcA6Mpmp8ollHoWQHF+Tx7NseDbJWoq3K8HchaSwt2wbppccqKBTCyo3FRRTKy IH5RqSsgoN74rZ9V3s3hOYRO1Qzf4r7/kt5x0= 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:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=FQm6t4lf/MhGommKzbaN/rLIk4K8mYvK+k8Qth1o19Q=; b=gspK8k293ka3qbjqDpU6b7IBgw270+xFAtjqKNa2iEt+VsoXkCyBEUVESa76o5XUqW qANcs6ovlWDfoFxUDWENtNxaGrTtiNUt9+yNSZMDCLWFxYpW3MxzFigy3BZkVedchD4P gdd8s7a8772WK+04UY5FKKn78BnVFk/WzaB1JFMqtQ1V6BR4WW9j8uKHLrPSDVcfYfV+ KuyNl5Ok+CATq66Ajh5SmYB7J/l10qFxIWHzi29NVKbo/hPP9nj6Zyg+fs5CdLP9J6bn +76nEFtd+ZTeAoJoajVu222CiM98VInMdsZvG2l14EfYOXk8hs1Fg5bYUEBNqhNupXNC o5rg== X-Gm-Message-State: APjAAAXmTgHw8xk/guT8ITcd5RxB6QyxBNiOgV2yOdRmUcgJDHSqFZht p2SHach87UigeVo1eaH+81gGaSnl X-Google-Smtp-Source: APXvYqxvMOL716gfH6D3TonzMNDohRlQ6eTIFz79lyvwS6smd/t2ooi2pCChZKvrqpqh9XxKIEglug== X-Received: by 2002:a62:a513:: with SMTP id v19mr58611729pfm.212.1556483392529; Sun, 28 Apr 2019 13:29:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:6b44:: with SMTP id g65ls551987pgc.8.gmail; Sun, 28 Apr 2019 13:29:52 -0700 (PDT) X-Received: by 2002:aa7:9a99:: with SMTP id w25mr37681858pfi.240.1556483392211; Sun, 28 Apr 2019 13:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556483392; cv=none; d=google.com; s=arc-20160816; b=xpAj/BdzqjNxmfI8M+BUPTgjPyuYdyiy2Djz+OEqDX+oFP+CMOC4IJmyrIC6s1mSVi Ne7GM9Jk5erJmpDTT8ETaSoxMHEm0G2ia3N0JwKuX208/iMYBzAGhWssy7kGGabie5Kw cjQU9JGTKkD9AIuU5/MTfc+n/n+a9TfKMUKYX+SbZY80ACUeGYQzJKMVRejrnWtPD3st LJCINK9bvOd68YOk1/hiOfrrC3Cez5kxBDS+0lrrqqn1x2s30R1U0FjUoiVR6lUW8oqh xFuVYokWhPx5G2U7nTtUd4WjEfggX4xHC7ZtY2HdlNd8tIikehrMPSH/RNG/+FKRa0XR DyHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ZHnh0SdHPqV5X5kpI8VHQMRjr7lCLTL/vWrH92Z3qlM=; b=H+3/BJHVQpU/SdRpBv+o0S6iYvScimD7BvbHSTMdxaH0LQew3CKDaHRnV7XT9dUjL5 wYF+GcobmEcpFMhVTRuYkGW/AsCaAfAJHOHHydpnjGS7ZzZ2jSsX5JyZNZIRbFjcL1vQ /sSRBcgGZXquZt1TmI2U9NdN1ZynAC7OTzP6+dzmwutbJyqKvpCvS49Bn0Tgsg1tyKn8 7dqxxqSBCLyhMMFwqSdMfya1+CfMBSQBs35xNZiAB1BpdhzNhHxuylccXHNrnl2VnITr dr9sXkhRX2haBnlk0x9Va/OuL+CGY7w+aODZqWtbMqWWEpK79yDZjGnqSO7UNQClLd6J M+hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RTF7rLoy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h12sor6771666pgq.71.2019.04.28.13.29.52 for (Google Transport Security); Sun, 28 Apr 2019 13:29:52 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:c145:: with SMTP id p5mr54649613pgi.339.1556483391938; Sun, 28 Apr 2019 13:29:51 -0700 (PDT) Received: from localhost.localdomain ([115.97.185.144]) by smtp.gmail.com with ESMTPSA id x66sm68841439pfb.78.2019.04.28.13.29.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 13:29:51 -0700 (PDT) From: Jagan Teki To: Heiko Schocher , Tom Rini Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 19/19] dm: MIGRATION: Update migration status for SPI Date: Mon, 29 Apr 2019 01:58:54 +0530 Message-Id: <20190428202854.8590-20-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190428202854.8590-1-jagan@amarulasolutions.com> References: <20190428202854.8590-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RTF7rLoy; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Now, we have few driver are fully converted into dm and few are partially converted. So, update the migration status accordingly. Signed-off-by: Jagan Teki --- doc/driver-model/MIGRATION.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/driver-model/MIGRATION.txt b/doc/driver-model/MIGRATION.txt index df659f3dd9..d38be3538a 100644 --- a/doc/driver-model/MIGRATION.txt +++ b/doc/driver-model/MIGRATION.txt @@ -59,10 +59,7 @@ No dm conversion yet: drivers/spi/cf_spi.c drivers/spi/fsl_espi.c drivers/spi/lpc32xx_ssp.c - drivers/spi/mpc8xx_spi.c - drivers/spi/mpc8xxx_spi.c drivers/spi/mxs_spi.c - drivers/spi/sh_qspi.c drivers/spi/sh_spi.c drivers/spi/soft_spi_legacy.c @@ -70,13 +67,12 @@ No dm conversion yet: Deadline: 2019.04 Partially converted: - drivers/spi/atcspi200_spi.c drivers/spi/davinci_spi.c drivers/spi/fsl_dspi.c - drivers/spi/fsl_qspi.c drivers/spi/kirkwood_spi.c drivers/spi/mxc_spi.c drivers/spi/omap3_spi.c + drivers/spi/sh_qspi.c Status: In progress Deadline: 2019.07