From patchwork Fri Nov 22 16:22:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21693 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65FFB23FDC for ; Fri, 22 Nov 2013 16:23:59 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id p10sf2473771pdj.7 for ; Fri, 22 Nov 2013 08:23:58 -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=InxmMvOUpol3B5VT1F3zz0R7KKdHaweCWv55Or3NSAo=; b=j+EmDg1G9Lg4mW+WILQd1Axog27Zh9ZZvoiGFdiry1VWgpqpgsu3vx1njJSz9ufiFL 3hJmQR9jn5FiKp+zMiE+yncCK23fUiXhG3Z5a7ruQp7emPzYcW9YYY88lJiq9M4go+NQ 499rY/jZW/fQFu3fQ3UN0sC7diFNLi2KUvyy43SVPNYLfNyEQuUuupN5Dcgy17P3zko1 qWIve1Unsbl5LRs3y48djegx+yefRZvQciJavAOU7XcYimBf/snRwnUedT1JFXrAed8B CyS7W+gVANxS5x9BN/qNYx2/iMaF4GXrQgKbDdrvl/0t6tfMIXng3v6kjaMlQy0gOMjF M83Q== X-Gm-Message-State: ALoCoQmeJQkUv12z+xIn3IHsGaO12khQuY/nsGm00V/Bk32qlUqnHWg9kTU+YZg5yCnjQRcrVF17 X-Received: by 10.66.20.100 with SMTP id m4mr4249753pae.36.1385137438681; Fri, 22 Nov 2013 08:23:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.195 with SMTP id a3ls985054qek.88.gmail; Fri, 22 Nov 2013 08:23:58 -0800 (PST) X-Received: by 10.58.108.196 with SMTP id hm4mr2547029veb.28.1385137438565; Fri, 22 Nov 2013 08:23:58 -0800 (PST) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id tq4si12830470vdc.155.2013.11.22.08.23.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 08:23:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.49 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.49; Received: by mail-vb0-f49.google.com with SMTP id p5so991039vbn.36 for ; Fri, 22 Nov 2013 08:23:58 -0800 (PST) X-Received: by 10.58.207.76 with SMTP id lu12mr2005570vec.30.1385137438488; Fri, 22 Nov 2013 08:23:58 -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 u4csp51533vcz; Fri, 22 Nov 2013 08:23:58 -0800 (PST) X-Received: by 10.69.18.234 with SMTP id gp10mr3581390pbd.105.1385137437529; Fri, 22 Nov 2013 08:23:57 -0800 (PST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id do3si14504308pbc.262.2013.11.22.08.23.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 08:23:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.220.54; Received: by mail-pa0-f54.google.com with SMTP id rd3so1521862pab.27 for ; Fri, 22 Nov 2013 08:23:57 -0800 (PST) X-Received: by 10.68.25.68 with SMTP id a4mr3572631pbg.173.1385137437129; Fri, 22 Nov 2013 08:23:57 -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 qz9sm52962938pbc.3.2013.11.22.08.23.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 08:23:56 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org, linux-mtd@lists.infradead.org, angus.clark@st.com Cc: linus.walleij@linaro.org, Lee Jones Subject: [PATCH 13/23] mtd: st_spi_fsm: Fetch platform specific configurations Date: Fri, 22 Nov 2013 16:22:50 +0000 Message-Id: <1385137380-28968-14-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1385137380-28968-1-git-send-email-lee.jones@linaro.org> References: <1385137380-28968-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.49 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 0b32fef..5bced00 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_32BITADDR; +} + 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;