From patchwork Fri Nov 29 12:19:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21870 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F368823FEA for ; Fri, 29 Nov 2013 12:19:59 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id ii20sf4151666qab.8 for ; Fri, 29 Nov 2013 04:19:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=43Qm8PnlVUEMZ8+pwp5EJI91bcPvlTlSPu/5Lxd7Wo8=; b=BA9WrfUVPQ9LTDZ94dQtUrSLz7AMlpclbIpJ1W3TigkkOwt6VJ1bbzqDlbiv0yqDVk +pDR3QoWjAicw5U1A/lYLj8IuB8CxfYvH8cTb+qSIfmHF7g2m/9el3mUx4HQ3IIW2IcF t7cyLkV/ELhE1U+1cl6tEy+fL4JrTyqgxymTwsk0eZ3s8ZXU+NK1stpXxcptkGFfFU/c 1a0HV1eVFMfHzvKgk5DYM4g90EOK11sj2wDLt/g9iR7GJ8flRI7AI4vF/HhSVbOxUgGv jslYO2IdLQNFIdQRkoA3RaNKwfS8JGTU8fvAbuL+PxdhmctPi4lkyLBMFlKMAAWMLdit DHrA== X-Gm-Message-State: ALoCoQlWQwZjKWAe3WneAjVNtUa8T1fDcJ3MogQFDo/z1Px3Td7Uo4XeG2Z+Mpc4HVjBA+twJp/C X-Received: by 10.236.62.231 with SMTP id y67mr22675273yhc.3.1385727599833; Fri, 29 Nov 2013 04:19:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.46 with SMTP id v14ls3774248qeb.31.gmail; Fri, 29 Nov 2013 04:19:59 -0800 (PST) X-Received: by 10.58.210.66 with SMTP id ms2mr42673917vec.10.1385727599751; Fri, 29 Nov 2013 04:19:59 -0800 (PST) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id th8si17685240vdc.76.2013.11.29.04.19.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:19:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id w20so6602050vbb.17 for ; Fri, 29 Nov 2013 04:19:59 -0800 (PST) X-Received: by 10.58.156.106 with SMTP id wd10mr42543795veb.7.1385727599608; Fri, 29 Nov 2013 04:19:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp87406vcz; Fri, 29 Nov 2013 04:19:59 -0800 (PST) X-Received: by 10.236.133.104 with SMTP id p68mr702094yhi.170.1385727599083; Fri, 29 Nov 2013 04:19:59 -0800 (PST) Received: from mail-yh0-f47.google.com (mail-yh0-f47.google.com [209.85.213.47]) by mx.google.com with ESMTPS id v1si36345231yhg.151.2013.11.29.04.19.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:19:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.213.47 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.213.47; Received: by mail-yh0-f47.google.com with SMTP id 29so6600972yhl.6 for ; Fri, 29 Nov 2013 04:19:59 -0800 (PST) X-Received: by 10.236.106.99 with SMTP id l63mr1943652yhg.81.1385727598904; Fri, 29 Nov 2013 04:19:58 -0800 (PST) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id m29sm101911689yho.14.2013.11.29.04.19.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:19:58 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org Cc: linus.walleij@linaro.org, linux-mtd@lists.infradead.org, angus.clark@st.com, Lee Jones Subject: [PATCH v3 12/36] mtd: st_spi_fsm: Fetch platform specific configurations Date: Fri, 29 Nov 2013 12:19:01 +0000 Message-Id: <1385727565-25794-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1385727565-25794-1-git-send-email-lee.jones@linaro.org> References: <1385727565-25794-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , All supported platforms are able to pass specific configurations via the Device Tree on boot. Here we add a function which is to be called during the probing process which will extract them, or make other assumptions based on capabilities provided. Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 5f21d14..1f54983 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -273,6 +273,15 @@ static int stfsm_init(struct stfsm *fsm) return 0; } +static void stfsm_fetch_platform_configs(struct platform_device *pdev) +{ + struct stfsm *fsm = platform_get_drvdata(pdev); + struct flash_info *info = fsm->info; + + if (info->sector_size * info->n_sectors > 0xFFFFFF) + info->flags |= FLASH_FLAG_32BIT_ADDR; +} + static int stfsm_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; @@ -331,6 +340,8 @@ static int stfsm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, fsm); + stfsm_fetch_platform_configs(pdev); + fsm->mtd.dev.parent = &pdev->dev; fsm->mtd.type = MTD_NORFLASH; fsm->mtd.writesize = 4;