From patchwork Wed May 11 12:46:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 9069171 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CAB199F1C1 for ; Wed, 11 May 2016 12:46:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE2F7201BB for ; Wed, 11 May 2016 12:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BA8B200E7 for ; Wed, 11 May 2016 12:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbcEKMqJ (ORCPT ); Wed, 11 May 2016 08:46:09 -0400 Received: from sauhun.de ([89.238.76.85]:36911 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbcEKMqJ (ORCPT ); Wed, 11 May 2016 08:46:09 -0400 Received: from dslb-178-008-255-018.178.008.pools.vodafone-ip.de ([178.8.255.18]:58368 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1b0TWe-0003YQ-RN; Wed, 11 May 2016 14:46:05 +0200 From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: Wolfram Sang , linux-renesas-soc@vger.kernel.org, Simon Horman , Magnus Damm Subject: [PATCH] mmc: sh_mobile_sdhi: properly document R-Car versions Date: Wed, 11 May 2016 14:46:00 +0200 Message-Id: <1462970760-3471-1-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.8.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang Replace hardcoded values with meaningful names and document what we know. Signed-off-by: Wolfram Sang Reviewed-by: Simon Horman --- drivers/mmc/host/sh_mobile_sdhi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index f750f9494410b0..c3b651bf89cb4a 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -39,6 +39,12 @@ #define EXT_ACC 0xe4 +#define SDHI_VER_GEN2_SDR50 0x490c +/* very old datasheets said 0x490c for SDR104, too. They are wrong! */ +#define SDHI_VER_GEN2_SDR104 0xcb0d +#define SDHI_VER_GEN3_SD 0xcc10 +#define SDHI_VER_GEN3_SDMMC 0xcd10 + #define host_to_priv(host) container_of((host)->pdata, struct sh_mobile_sdhi, mmc_data) struct sh_mobile_sdhi_of_data { @@ -109,14 +115,14 @@ static void sh_mobile_sdhi_sdbuf_width(struct tmio_mmc_host *host, int width) * sh_mobile_sdhi_of_data :: dma_buswidth */ switch (sd_ctrl_read16(host, CTL_VERSION)) { - case 0x490C: + case SDHI_VER_GEN2_SDR50: val = (width == 32) ? 0x0001 : 0x0000; break; - case 0xCB0D: + case SDHI_VER_GEN2_SDR104: val = (width == 32) ? 0x0000 : 0x0001; break; - case 0xCC10: /* Gen3, SD only */ - case 0xCD10: /* Gen3, SD + MMC */ + case SDHI_VER_GEN3_SD: + case SDHI_VER_GEN3_SDMMC: if (width == 64) val = 0x0000; else if (width == 32)