Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp954191ybg; Mon, 27 Jul 2020 04:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsgYUaEOqJDuBsq8y9OrWUHsPoJsioF9osZdKTXSYQTWshcDBB180ldHpqCXYSfCjdJ7o+ X-Received: by 2002:a17:906:2451:: with SMTP id a17mr17585324ejb.274.1595848400857; Mon, 27 Jul 2020 04:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595848400; cv=none; d=google.com; s=arc-20160816; b=FGPeivN935pNOAH8dxXplbN40GeKFNhM+/WtX1tz42H8cLjvXrG7tModeEfZ4TntF6 8lI/PDoQwJNe2QR6g0DM/Ws1GfqKQlG2qy/3vBHlZa6pUguv8k6v0kVc+GQcPXkJXpKb 2nvNyNnbLw/kMP9LaMA9ZT9y7Q7v0C9TK9CSm/7+JspNG/Rg4Tau80GENWZBJQPYOZp2 FHrp+DbRkTnoHqoTjJUHf11Qa4o4rjyOh4WDk5wS6sh6fuTVNDNcRgOJT/o6FBELVZzy B5Nmur7vl2o4YYRd21zt4XW42W2WSlCbm8DZAi5C02Fdqs6fK0eYnQjPbHysBnCDXbHX uGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cbduYTD+9CMqU4+Uctbdx8CSKnpIPzj2a4h5IJb0RaA=; b=LyEiXqZJrYKO5M5GcaNhil3VVxlc+XnG5o5fjsM8OI7/SCG9YuK1Tz+dgCInBvf/b4 cUHzACxjJDlL6TZIBjJkYvmFcEjQP8Pn/KISw25TxtfM+QJa71BuF95j0VnVQVMYF5XF Q7wo9UoSizWTD1qx1W8S56kTg8JWuR6AceXlmAhaqbNHyDSMaaxZrnT9sb+xvQwbjTux UzqoTHkGL2cIu0qqk5vcR3v1rv4ck3dxo1/d8fW2vUQurXnfglh39rsR0aLKTyo11b8o mX2CA+96ztjClSYYJVj3mxjvGMuYONRqtXKVm2J+UlJ8XiVV6AIpOLXi83ekZ0pQBMYQ Utcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si3562536ejr.116.2020.07.27.04.12.59; Mon, 27 Jul 2020 04:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbgG0LMy (ORCPT + 99 others); Mon, 27 Jul 2020 07:12:54 -0400 Received: from mailout10.rmx.de ([94.199.88.75]:46431 "EHLO mailout10.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbgG0LMy (ORCPT ); Mon, 27 Jul 2020 07:12:54 -0400 Received: from kdin02.retarus.com (kdin02.dmz1.retloc [172.19.17.49]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout10.rmx.de (Postfix) with ESMTPS id 4BFcbk088pz31wH; Mon, 27 Jul 2020 13:12:50 +0200 (CEST) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin02.retarus.com (Postfix) with ESMTPS id 4BFcbK2FfZz2TSDj; Mon, 27 Jul 2020 13:12:29 +0200 (CEST) Received: from N95HX1G2.wgnetz.xx (192.168.54.121) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 27 Jul 2020 13:12:29 +0200 From: Christian Eggers To: Greg Kroah-Hartman CC: Arnd Bergmann , Mark Brown , , , Christian Eggers Subject: [PATCH] eeprom: at25: allow page sizes greater than 16 bit Date: Mon, 27 Jul 2020 13:12:18 +0200 Message-ID: <20200727111218.26926-1-ceggers@arri.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.54.121] X-RMX-ID: 20200727-131229-4BFcbK2FfZz2TSDj-0@kdin02 X-RMX-SOURCE: 217.111.95.66 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Storage technologies like FRAM have no "write pages", the whole chip can be written within one SPI transfer. For these chips, the page size can be set equal to the device size. Currently available devices are already bigger than 64 kiB. Signed-off-by: Christian Eggers --- drivers/misc/eeprom/at25.c | 2 +- include/linux/spi/eeprom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index cde9a2fc1325..0e7c8dc01195 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -261,7 +261,7 @@ static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip) if (device_property_read_u32(dev, "pagesize", &val) == 0 || device_property_read_u32(dev, "at25,page-size", &val) == 0) { - chip->page_size = (u16)val; + chip->page_size = val; } else { dev_err(dev, "Error: missing \"pagesize\" property\n"); return -ENODEV; diff --git a/include/linux/spi/eeprom.h b/include/linux/spi/eeprom.h index aceccf9c71fb..1cca3dd5a748 100644 --- a/include/linux/spi/eeprom.h +++ b/include/linux/spi/eeprom.h @@ -14,7 +14,7 @@ struct spi_eeprom { u32 byte_len; char name[10]; - u16 page_size; /* for writes */ + u32 page_size; /* for writes */ u16 flags; #define EE_ADDR1 0x0001 /* 8 bit addrs */ #define EE_ADDR2 0x0002 /* 16 bit addrs */ -- Christian Eggers Embedded software developer Arnold & Richter Cine Technik GmbH & Co. Betriebs KG Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918 Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477 Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler