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: 10322621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4DF36053F for ; Wed, 4 Apr 2018 13:18:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A325A28CF7 for ; Wed, 4 Apr 2018 13:18:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97C3828D23; Wed, 4 Apr 2018 13:18:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7231328CF7 for ; Wed, 4 Apr 2018 13:18:12 +0000 (UTC) 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 1f3iIc-0006kb-QF; Wed, 04 Apr 2018 13:18:02 +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-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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), }