From patchwork Wed Apr 4 13:16:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894993 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CF82il3g"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="qv4MLYmq"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GRNJ44yQz9s08 for ; Wed, 4 Apr 2018 23:18:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dmvr6NpllBF4Xd1m3cPwXw1me0cDXadL4c39BK9UJOE=; b=CF82il3gQkWFcouv2wEFXKrHzR cv5ep9yhGT8jqOh1Md9R2oQf9yU4EzXXBN9pVdodO0xQLO3NyiUHJZmgiKopSaWy30C82Rr8/geiE JvJ5nR5BUS81EyKJXzhsHcNVYvEA9LYyOfQhcIGR8R8yR9j7f0EyKbR32OxVcnjWhIL+RM4yDs4uq V4enihmv9XVafg3yPIoo6NrZLF46m+e/MPiRUoxg7EDlFSYBhv20nAsImWSTRF0ZiNy+cP+kGhQtq ZVlzCZfjMsSwvnLkERRpOLTgLlEyjaKmPmPdGS77RAU2U6sU2eOAQHrTxjoJtWO6LjVHlPbB1wbSQ jUb8OjLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3iIg-0006kb-8l; Wed, 04 Apr 2018 13:18:06 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3iHR-00064v-K2 for linux-arm-kernel@lists.infradead.org; Wed, 04 Apr 2018 13:16:51 +0000 Received: by mail-wm0-x241.google.com with SMTP id x4so42362913wmh.5 for ; Wed, 04 Apr 2018 06:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=788VENSZyWItMe7uwthR7n9EwLT/gm4SxhMQ3dam8EA=; b=qv4MLYmqMfpT40wk8LBn3kuO/K6lIhhg6nFaM/LP3WXspZJ1gGxBE/dkKrj6mmZ3Ie QvdM6ji2k6ZUP1LrhcnorbkeCJWR5t3kdTCOoEEpN4Qq3KGbTbPejoLNByNlOadN9YHm 8WFDBf7pURqZlNIlK3B6gGenLuNj5hrFIOM0JlbHezlbf2vdcg/AzKN/0UvB1Dah19vX FYDiyjDnYCstin5DO4zxvJXJ4k0+z5sNEM15/MypVruxq95DviRK7Gc0NeuOIiZ2mocM js3pWiYsq7114rfrYe1CCiYk8LPJB9mXY1fwLpgHeOL2F1Vr+4FDHUExsxOQmZxjH5hs FbVg== 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; bh=788VENSZyWItMe7uwthR7n9EwLT/gm4SxhMQ3dam8EA=; b=eJyiYZnTaKt6JDX2vVjY273Pmp7Qe+jFr7WFiRCG4B91Fk0JM+lxzy4vRzvk1hYFTy DMbr/3lC9K6l31IZRoSd00B7dWLz9jQ0ZbW56oiCf78v9PCA6sHSxyGLC3SsXYp/cj0P 3v1s279xlUUj9GjBwhs5bgCvwWM/WKgHA2L8KsGt7Detgm65/iuiUnsoPoNRI45gJu7y EmOkMCTVUrkVkA6D5ke/xHz8vm22CcPkY3BeeBZiKHyjmkkEEEH8xEsxw+ItxQjA2Gh7 8vK+dqFSqkoWGZunk2utpGgtjwet8PhWicBrtlNg+VTimy6JhqDJ4eVsHVTgYG2gW5Gj vQEA== X-Gm-Message-State: ALQs6tBLeFnr0w7hG62R5iPGL2we3STw88+bUuiybpxC2HD4rjLEWYtn 074K0P2mGlnVArQS7IlXxKlcog== X-Google-Smtp-Source: AIpwx4/4UWyC/A5wbqe3gooco0mFoDxHxd0S+4eFWU5egWqwvHedMj1cKB6F7detO55Azt7tsd4uKA== X-Received: by 10.28.69.93 with SMTP id s90mr7113375wma.71.1522847799964; Wed, 04 Apr 2018 06:16:39 -0700 (PDT) Received: from brgl-bgdev.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id g38sm8523884wra.77.2018.04.04.06.16.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 06:16:39 -0700 (PDT) From: Bartosz Golaszewski To: Shawn Guo , Sascha Hauer , Fabio Estevam , Russell King Subject: [PATCH 4/4] ARM: imx: pcm037: use device properties for at24 eeprom Date: Wed, 4 Apr 2018 15:16:27 +0200 Message-Id: <20180404131627.9135-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180404131627.9135-1-brgl@bgdev.pl> References: <20180404131627.9135-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180404_061649_662804_DEB2D95A X-CRM114-Status: GOOD ( 14.65 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:241 listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Specify the exact model instead of the "at24" wildcard and drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-imx/mach-pcm037.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c index b787ba6897e4..004737c40fda 100644 --- a/arch/arm/mach-imx/mach-pcm037.c +++ b/arch/arm/mach-imx/mach-pcm037.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -263,16 +263,15 @@ static const struct imxi2c_platform_data pcm037_i2c2_data __initconst = { .bitrate = 20000, }; -static struct at24_platform_data board_eeprom = { - .byte_len = 4096, - .page_size = 32, - .flags = AT24_FLAG_ADDR16, +static const struct property_entry board_eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 32), + { } }; static struct i2c_board_info pcm037_i2c_devices[] = { { - I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ - .platform_data = &board_eeprom, + I2C_BOARD_INFO("24c32", 0x52), /* E0=0, E1=1, E2=0 */ + .properties = board_eeprom_properties, }, { I2C_BOARD_INFO("pcf8563", 0x51), }