From patchwork Wed Apr 4 13:16:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894991 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="LPA+rd9k"; 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="xSbQPs1M"; 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 40GRLy3wRNz9s0p for ; Wed, 4 Apr 2018 23:16:58 +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=EwJf422YXahCQkeTXuMyeewcpx8ZKVsv2q7vy2pHObw=; b=LPA+rd9ke34GUgK44JTF28y3Rl HnX6fV+MxxmSzTQsFcSC/1UHp1Jt7XdQZvh0qJu1qTTh+LofW5GrmhsUidc9FXNATxZJ/76kINIG1 PeqPXMX2m42ckU3gy19ooXvFC5UeuRGDmjhSBjyII7bHJFuNULA/2EtuJ5Tjn3U+cIEDifQX9PznX 1CWi86RqTUPMDaqsr9bdkKQd1bJ4Bo5t9cJWFFnGFE/AkYa7L1ZoMB/INJw/qncn6CqR9QIYFZfx1 mWHF0huXZBhzXP1XQQOKJ0wFvBv3gu+e5DDtTn47eZPkfHTCiUbmqALIrrGyJ9IBWC3ikGIPSLWxp Zw/Xlp7A==; 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 1f3iHW-00066w-EM; Wed, 04 Apr 2018 13:16:54 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3iHQ-00064h-HI for linux-arm-kernel@lists.infradead.org; Wed, 04 Apr 2018 13:16:50 +0000 Received: by mail-wm0-x243.google.com with SMTP id t67so21253687wmt.0 for ; Wed, 04 Apr 2018 06:16:38 -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=Lz2x1iynHu2JlPIr4gY/3O1agkeFXmxLqps+INQJZsQ=; b=xSbQPs1MbEFWrCPTLSGs4QAFT3zezph8/JI0Vh26tYjbdDVkSQcv9M3WtSrWkHo4HH iFTiTR+Q0nMCu7kkhmr8hz7ZkDY2jMx8j0k7tnLeHr5s/t/FxqCtkOPeyamycE2k3gww CzZI24MKu/JwC8yV4XlG2kIWs56ybGvOKLFCIVopGlouFh/r6+hltflp9TKON7NhRU3t DgLbBGOlLtIOND1sIYNF0TWQ53PXUo6RPxIP0GxczaDNwXBIF2AEGszleKu3joywnKpo fmodtcY36GlBizwcYnexnJiDiCa71FPucF3Mw9AE4SuhGUapSCqyBHjwH5c+kuHt997y fc7g== 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=Lz2x1iynHu2JlPIr4gY/3O1agkeFXmxLqps+INQJZsQ=; b=csId0/DqcI4tkhZoUBFFZyLx211WNdesfRfvghO2q58k74HpABG0j3AmsEzeicJU// KWt0aT3BKYNRCpyK6s3X5/rwPQSx+ZHczyEVlm3I6e+SlQZlB5RTPsxjvrB8F9UJZWi8 E+IEjN56N0cg7qnaiNFyGmfmCv31ex7bKpLV5WaWktbc1v/km5tolWP4Tr84/Nx49/bY spB1AifBVImsmk39XHYmSadveRrjLEffTgC3t8mrmn2Trny0FGFxwaiTRdYn5ND6dC+j Jy8JZo/qgJOhckffAjRjRQskRptirHpiSMvRh+l4IjgckENw9wVMz2wE+P7q6aXMps8q nabw== X-Gm-Message-State: ALQs6tAtUF+PAd+Fodrh5lpkTOVHb7OUWcQgHEAu6gD+8DMM1lOHVVx0 Bc0TP8zb3zta57+MhvNuvmwkpg== X-Google-Smtp-Source: AIpwx48OSsqpeOp8apEPtjsvxLZmvU6jzcpd6j6YVa/XZ+61NRU05la28KBGO4oFQ43IoQHynTmAug== X-Received: by 10.28.133.197 with SMTP id h188mr6692585wmd.18.1522847796785; Wed, 04 Apr 2018 06:16:36 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 06:16:36 -0700 (PDT) From: Bartosz Golaszewski To: Shawn Guo , Sascha Hauer , Fabio Estevam , Russell King Subject: [PATCH 1/4] ARM: imx: vpr200: drop at24_platform_data Date: Wed, 4 Apr 2018 15:16:24 +0200 Message-Id: <20180404131627.9135-2-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_061648_571540_508A4603 X-CRM114-Status: GOOD ( 15.36 ) 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:243 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 The information contained in the platform data struct is redundant. Page size == 1 is the safe default assumed if no pagesize property is given. The EEPROM size can be indicated to the driver using the correct model name. Drop the at24_platform_data entirely. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-imx/mach-vpr200.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c index 5ff154c9a086..da3336aaa4c5 100644 --- a/arch/arm/mach-imx/mach-vpr200.c +++ b/arch/arm/mach-imx/mach-vpr200.c @@ -29,7 +29,6 @@ #include #include -#include #include #include "common.h" @@ -145,15 +144,9 @@ static const struct imxi2c_platform_data vpr200_i2c0_data __initconst = { .bitrate = 50000, }; -static struct at24_platform_data vpr200_eeprom = { - .byte_len = 2048 / 8, - .page_size = 1, -}; - static struct i2c_board_info vpr200_i2c_devices[] = { { - I2C_BOARD_INFO("at24", 0x50), /* E0=0, E1=0, E2=0 */ - .platform_data = &vpr200_eeprom, + I2C_BOARD_INFO("24c02", 0x50), /* E0=0, E1=0, E2=0 */ }, { I2C_BOARD_INFO("mc13892", 0x08), .platform_data = &vpr200_pmic, From patchwork Wed Apr 4 13:16:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894992 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="GT1PxXzp"; 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="xMLNL59V"; 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 40GRMc14wtz9s2S for ; Wed, 4 Apr 2018 23:17:32 +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=55wf1Q48b2JcM6VJGHPNacElrXBJjmBNhIJnNydY2Es=; b=GT1PxXzpZmisYSfQblTBvhebci ulG/K/gwRYQ8dIUkDGjbgTF6XgSHUSzpberlQgIkyDFJBKp9Tjr/84PaKcDZT+e3Bvh5LbWcOWgi/ aim0wFoSuEH+0NxABET+92NfLFYHeY9zKIRrvdoOmqC+BRJZ0zrTJPjh1x0ANhhhJdU1kYW1V3SIZ tRz7fm+OzoVFrYDzeEHs9W+DNl7ks9bq6/uFfQLqrm20lWIs0Y3R2SqDaWOh0nyX0onzDk6tFQq7Q qjgllOHAJICPvB/DsFjg6JCciRwmXhidxBBv25H+AObFHzBu4mDgWu2BDwBuuUbjWnmwFrZw9NrX/ Ql9juTXA==; 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 1f3iHv-0006Lj-L4; Wed, 04 Apr 2018 13:17:19 +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-00064p-K0 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 r131so42398014wmb.2 for ; Wed, 04 Apr 2018 06:16:39 -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=h2w3fU4XYsZ69DMj5+bTuDUfH1VnGOOfK1N7tB9SfJc=; b=xMLNL59VpcO1A6+aSLlLRNKFwcIyBdYf348DvUnbvBZVD4VOR7LqgbtQmzyY8i66+m UEfL1WUXAru1DGgJtIV36uYbgndPg0TWdeCUrFc2k5zsSIpjDkgp1I8DY0Vpz+xSAqQh V8jJGAIo2eF+g0VZP5YPFcDc5YCkAw8AORWPsAU00efEyQQmisgIgMuCYI1MMnzvGH46 lIOXo7JKPaa/Fovzozlp7LLfSvDFAfAD1CO6/Hvmc/UJdQOhlVrsTm/biBGTDZKgkEZ1 g6deImCZGyl0OoXuqlCw9duAwqA2j9OMbWSKGACmLY8PeZkMNilIlUKOIUu8Cq4QgFIf Qvuw== 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=h2w3fU4XYsZ69DMj5+bTuDUfH1VnGOOfK1N7tB9SfJc=; b=Ql/VuOa89ZSINsiHujqDZilRbWHVtE7qtGi932hd+g9D1z0WoNegH/9/2Jp2V9Cvzo adXdkJiVymlhj/ENWezPm/fd/JYqzScNDWj/cNd/qRlS9uK2Q2NqsWJjtPvSfLxDgCk5 4U6np4PXnzxFzQ2bkcXIssNsavQ2teQuDekhhwo2lhJ4PGlKc2FvuOQFoUUmq02/wzQi r5s/ur1lS9hhBZRnnF47mfidZS6L/KftLSMoVG/8o+rYJ9TH2mILfmmcreNZ6wbkh1Z3 IGxgbvcYd8AW3RxEzeFa3/7QoFhbRMhE+bse0Ey6QFBYYQPA8QODn6blBfWo3zfbQ3tl M9DA== X-Gm-Message-State: ALQs6tDaWni0Ns/sqY2lsOyPX+nWNpfNhKsqkm1WQMg+X/C7wq3DVrsS UBis1N5TgzjB6XGz2UARdj0mlA== X-Google-Smtp-Source: AIpwx49w33jY5/m1uJ9kEyYDsBebSqnWx692C2HVKWrWX8eiWP+vw9QMdR9l9VAZw+cdwIGVL/JtUQ== X-Received: by 10.28.4.87 with SMTP id 84mr5383133wme.86.1522847797777; Wed, 04 Apr 2018 06:16:37 -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.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 06:16:37 -0700 (PDT) From: Bartosz Golaszewski To: Shawn Guo , Sascha Hauer , Fabio Estevam , Russell King Subject: [PATCH 2/4] ARM: imx: pcm043: use device properties for at24 eeprom Date: Wed, 4 Apr 2018 15:16:25 +0200 Message-Id: <20180404131627.9135-3-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_667150_CB973F56 X-CRM114-Status: GOOD ( 14.42 ) 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-pcm043.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c index 78e2bf8dcd96..e595e5368676 100644 --- a/arch/arm/mach-imx/mach-pcm043.c +++ b/arch/arm/mach-imx/mach-pcm043.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -110,16 +110,15 @@ static const struct imxi2c_platform_data pcm043_i2c0_data __initconst = { .bitrate = 50000, }; -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 pcm043_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), }, From patchwork Wed Apr 4 13:16:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 894994 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="DYd4ChkN"; 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="dNoz1AL9"; 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 40GRP90MP8z9s08 for ; Wed, 4 Apr 2018 23:18:53 +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=JDA6KNb8ByCC0WDlTrJj54mtg1AXY9XXDzvHjNEcX2A=; b=DYd4ChkN8TSbhWtfPxrSfF2SD/ xGMGhfoVq4XBNbk6kmlNZQqM4y9nI3a2YG40vOs8JgOO+xnb2aSaWXVs8SJMd+i6WcjFwOVVBpG0z CwRxCmhPBcUVIWsxAC82Nf+c3DDgpCREsUyd1ZKI73c1RL+ytXPjxi/dWeFvMMqXET1XLF6W0FT9j 2n1V1TC2lpHZswGZP9H/10xvFtFyWi9Y/VEH8sWJ2UWKjDzmbyQU7im7avGmvhykkPt1FkpBHJKop SchkzU+9F7q0fcuBpw5c7MKic9zemp10PpNX7khvu3lTxJ9y77qerj9PeTW/WnQdwQnOoP7NlNYQs tpmsRjow==; 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 1f3iJL-000778-J3; Wed, 04 Apr 2018 13:18:47 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3iHS-00064s-BT for linux-arm-kernel@lists.infradead.org; Wed, 04 Apr 2018 13:16:52 +0000 Received: by mail-wr0-x241.google.com with SMTP id p53so22604508wrc.10 for ; Wed, 04 Apr 2018 06:16:40 -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=KNJwHWJr1K6J3ewaL9jlO1ZYOEr7xlMBBVVX98GQDIQ=; b=dNoz1AL9TPDyyeKVvW/+qKmQHbKTYXQFbPyAG65VE/Dp4CNJ5Q0K6XPVzD5xfq6myG mcG1L3B5OMMNEoJBvKSmeM+Iyb7NtbBGuSO8+k0WC4XGNAcEkwOiHLf5ph5m6MvdVSvf Jrk2/BNtZ4H+oxavnnt362NOo+c1raofPNQ5fvSZ+RpSnNjPZbhdui9Y1dKbCnK+7fyB e5FMImRXfxw9BHW8Fc4uDB1lEFCRVxr+naJShuihyM5ZwwMFVlBnC6J8CPlXYIdh0R6b xT67bHdOgdyl09eN1XAHx4RQiUiIeOCrZsi+g+HSdhvf4K8yESPsWNONWdvIOfyyaT3H Y2LA== 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=KNJwHWJr1K6J3ewaL9jlO1ZYOEr7xlMBBVVX98GQDIQ=; b=rPVgAQMJ6FLEcWNxqkyl45MDg+W9WT4slKaqEiCfCmkR//VXssZMT29Qe2fNUy5DXm sF8LLmz33ZKfijV1oKp2gcRzxo1kc6a94zwM57YNqlO2TPs3bjyHzmjKHWL9uAv28pr6 13ANRMHT74bF9g75/hv7GKeKeH/0ZfmUFWFonNN60SEWUt6RRZ1sJ9rjQVpoqUMSLkSe ReWfn1g47hnOPLZqx+BeATQx3juwwu36r/x9aDNFk+LVx4r/HsYAHwqNB3b3yabjkoyl JyiONj17TOlHs7TPBX9CdPkd6IYnVTjVAx/4hbJWzn/TPLxi4lLiQN1GGX41RtT6Is2X J3Sw== X-Gm-Message-State: AElRT7Ek2t+g9f95MT8BBqcMsvkWx99YTGHBSvu0cd8h34GDwAFak7G0 xQh8SihTDtYR/fHNIE3aasWitQ== X-Google-Smtp-Source: AIpwx49gBWo+WaLLXVfNvnnS726+cB9//In0fqwHR6GDfeSHQP2y43IkwQJqjyGW1PX37iOySOCFFQ== X-Received: by 10.223.150.175 with SMTP id u44mr12402024wrb.104.1522847798968; Wed, 04 Apr 2018 06:16:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 06:16:38 -0700 (PDT) From: Bartosz Golaszewski To: Shawn Guo , Sascha Hauer , Fabio Estevam , Russell King Subject: [PATCH 3/4] ARM: imx: pca100: use device properties for at24 eeprom Date: Wed, 4 Apr 2018 15:16:26 +0200 Message-Id: <20180404131627.9135-4-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_061650_410355_14C8EB1C X-CRM114-Status: GOOD ( 14.03 ) 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:c0c: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-pca100.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index ed675863655b..5714e2f1b106 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -168,16 +168,15 @@ static const struct imxi2c_platform_data pca100_i2c1_data __initconst = { .bitrate = 100000, }; -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 pca100_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), }, { 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), }