From patchwork Thu Jun 28 14:32:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10494159 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 C860F6022E for ; Thu, 28 Jun 2018 14:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0C2D2A0C6 for ; Thu, 28 Jun 2018 14:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A414F2A0F0; Thu, 28 Jun 2018 14:39:40 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable 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 557762A0BE for ; Thu, 28 Jun 2018 14:39:40 +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=VuW5lg/j7qgRMZkgYSQWpnNc0831uIGzAc9KAZNrWDs=; b=MZNgu1FNMPAv6bixJjdlfnhLgc ag98tfveOa22Qe7WENmdUxD0Hwo8u74yiMMbVWh2sv9/R+qEOh1Dye34DLrO7Aw8C5VIFw3auy/z7 J9g3WO13+1qBAYk2FVTAabEuD9G6iuaKo5As6T4iyssu7FgAze/Uuxsmnjys/9dw/WfHtRF6CEwxJ vnNhQjZYNUmEQa/+UFKKtlifqAyG27KaCBcREeI4hXNnuO4mWnszbYJ6qM8skiMZtWm+5FtLAz/VZ ln1v1WOo/TuamqLwCFZWAAGMGALbvAmeMH6Opik8+dY8AgjVVhHi49/iEjcRgqm9lP+7hYRaVGVwf P9uFtxEw==; 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 1fYY57-0001Li-Bk; Thu, 28 Jun 2018 14:39:33 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYXzN-00058m-4n for linux-arm-kernel@lists.infradead.org; Thu, 28 Jun 2018 14:33:47 +0000 Received: by mail-wm0-x244.google.com with SMTP id z137-v6so9354666wmc.0 for ; Thu, 28 Jun 2018 07:33:26 -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=bR3ra0J3nB9yOQmIhsiBHpNBXbsCR87+f3+DqJeGKRU=; b=Z2v3sDcZhrzjxrKzXBicFeIdMJfWZ7kpd898A5CFvEguC14+2Ag820J2s0a3U6hwms XkWxNtzl931u4h7s8Ju0R9ODOyokde6sWppdPvtrkFsbjcybXk7hmOHZUIW+QyiJwgfn +Z3ZvomhOElbp7unVvhuOEmF5VHI2pXXrrjvsRpWkv+VtYasaxUk5bfmWNrQzFswnBFY aFVpKF/iTEW0n2eEyH/u58nMJUPRx1O97/upLrcwl2XUPnmlSQO2juJRoaDkzU55aT+C SVSVNIK+Co1CFg1ASnGyMzsUZIcbaS2mXKa4MLGonjg34unGhS+BoO1POSgxjTvyBFja WWFA== 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=bR3ra0J3nB9yOQmIhsiBHpNBXbsCR87+f3+DqJeGKRU=; b=C0VWRa57IVMNjk/3vp2ntcrONVJ8AKBXS/x6Hqd5OqKHAmnqb/oZEyWHzq+69TwhEL SzgysTGMLPChs1EhTFoayA0MQ2YxG/W4fuf6JILtYRyhWLHh2ylZ51riZRiqn9ESDZIz HHkLo7CzuST8XhTh+ayvZ8v9TQC6/aKVmQYjGIHlrTWhDXU82eD/5+4r6QKKFPRmxmUo clzWn2QG6LtJuvdI+lrMytrup0qm8rD1t/mOvm5RX6NaKtutg8JVdGqSgFrG1WqgQoV6 MOgKgVtextpjm4YNaAMfgQzl26kZN6jhBYCJtbFvG39bqLU/IagOWrJTJnjPB3ESc1Lk f6xg== X-Gm-Message-State: APt69E3zIMBlLTUJsIm2TSp1XOPFnNo+uM7x8btbZnsukDyRsvmsnYLS KsLues+A/POIkG8CNRakGAfaxQ== X-Google-Smtp-Source: AAOMgpcOAEfzvwYS3+eOtBpSlWVJw3l/4X8J58ssSDNCD+lTc6YH7srqTHgznZwIwoHjJDv0aXbAzA== X-Received: by 2002:a1c:d509:: with SMTP id m9-v6mr8692371wmg.69.1530196405479; Thu, 28 Jun 2018 07:33:25 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-87-41.w90-86.abo.wanadoo.fr. [90.86.29.41]) by smtp.gmail.com with ESMTPSA id 4-v6sm8037499wmh.14.2018.06.28.07.33.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 07:33:24 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Andrew Lunn , Jonathan Corbet Subject: [PATCH v3 13/18] ARM: davinci: da830-evm: use device properties for at24 eeprom Date: Thu, 28 Jun 2018 16:32:39 +0200 Message-Id: <20180628143244.4561-14-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628143244.4561-1-brgl@bgdev.pl> References: <20180628143244.4561-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180628_073337_605285_2EB03B2F X-CRM114-Status: GOOD ( 15.15 ) 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: netdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski 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 From: Bartosz Golaszewski 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. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da830-evm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 4a2fe8142a2f..08a23e777eca 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -419,12 +419,9 @@ static struct nvmem_cell_lookup da830_evm_mac_address_cell = { .nvmem_name = "1-00500", }; -static struct at24_platform_data da830_evm_i2c_eeprom_info = { - .byte_len = SZ_256K / 8, - .page_size = 64, - .flags = AT24_FLAG_ADDR16, - .setup = davinci_get_mac_addr, - .context = (void *)0x7f00, +static const struct property_entry da830_evm_i2c_eeprom_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 64), + { } }; static int __init da830_evm_ui_expander_setup(struct i2c_client *client, @@ -458,7 +455,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = { static struct i2c_board_info __initdata da830_evm_i2c_devices[] = { { I2C_BOARD_INFO("24c256", 0x50), - .platform_data = &da830_evm_i2c_eeprom_info, + .properties = da830_evm_i2c_eeprom_properties, }, { I2C_BOARD_INFO("tlv320aic3x", 0x18),