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: 10322619 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 5D3E960318 for ; Wed, 4 Apr 2018 13:17:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C09428C3E for ; Wed, 4 Apr 2018 13:17:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4066928DCA; Wed, 4 Apr 2018 13:17:26 +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 6DD7328C3E for ; Wed, 4 Apr 2018 13:17:25 +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=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 1f3iHr-0006Lj-N8; Wed, 04 Apr 2018 13:17:15 +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-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-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), },