From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35D77C433F5 for ; Sat, 18 Dec 2021 13:44:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A0D280F67; Sat, 18 Dec 2021 14:44:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1639835070; bh=1/6jNP5IFdOSKNIJ/qKGU33aLYAr5Js9QBUkS7v8gj0=; h=Date:Subject:From:To:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hNR7zxouE1csyqeHYDeBxz8yWMVINYx6BPp3aJyg6co1opRsrJWsIIysbLB1KuvXv j+iLSCTzdpw4zwE4Kpp466yyzMIX5l9AnAZEgeX/S4QSOD2R4X7uzOLylxgHACWU4l o/hUsTs6BdYFaknK6l0EEmrLxjSulPtCczLjhtKTqwRCxaIFKtyNU1aTO4TJrWfdJS cF9c9I0IgI86POUlY/cP7NGQxTLM9/MlcE8ZFHOk9ofOelaYABtwIILabBG6nImLhd /7iS3n+uJDjGoQhvbTtyFm8QSoy8IO9ZQ/wuC3bck0BSOLLv2UcGvWF4x32SLINogT V07L70I4hcnUg== Received: by phobos.denx.de (Postfix, from userid 109) id CDA07830F0; Sat, 18 Dec 2021 14:44:27 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F251B830C4 for ; Sat, 18 Dec 2021 14:44:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (unknown [91.198.250.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4JGRsg3sLmzQjbj for ; Sat, 18 Dec 2021 14:44:23 +0100 (CET) Message-ID: Date: Sat, 18 Dec 2021 14:44:19 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 6/9] arm: mvebu: axp/high_speed_env_lib: Switch to DM_I2C API Content-Language: en-US From: Stefan Roese To: u-boot@lists.denx.de References: <20211118081939.861407-1-sr@denx.de> <20211118081939.861407-6-sr@denx.de> In-Reply-To: <20211118081939.861407-6-sr@denx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 11/18/21 09:19, Stefan Roese wrote: > After all Armada XP boards have been switched over from legacy I2C > support to DM I2C, let's now also convert this serdes code to use > the DM I2C API. > > Signed-off-by: Stefan Roese Applied to u-boot-marvell/next Thanks, Stefan > --- > .../mach-mvebu/serdes/axp/high_speed_env_lib.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c > index ea3b4c7d5b72..0b63664dd8be 100644 > --- a/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c > +++ b/arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c > @@ -77,6 +77,7 @@ static u32 board_id_get(void) > > __weak u8 board_sat_r_get(u8 dev_num, u8 reg) > { > + struct udevice *udev; > u8 data; > u8 *dev; > u32 board_id = board_id_get(); > @@ -107,8 +108,11 @@ __weak u8 board_sat_r_get(u8 dev_num, u8 reg) > } > > /* Read MPP module ID */ > - i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); > - ret = i2c_read(dev[dev_num], 0, 1, (u8 *)&data, 1); > + ret = i2c_get_chip_for_busnum(0, dev[dev_num], 1, &udev); > + if (ret) > + return MV_ERROR; > + > + ret = dm_i2c_read(udev, 0, &data, 1); > if (ret) > return MV_ERROR; > > @@ -124,13 +128,18 @@ static int board_modules_scan(void) > /* Perform scan only for DB board */ > if ((board_id == DB_88F78XX0_BP_ID) || > (board_id == DB_88F78XX0_BP_REV2_ID)) { > + struct udevice *udev; > + > /* reset modules flags */ > config_module = 0; > > - i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); > + ret = i2c_get_chip_for_busnum(0, MV_BOARD_PEX_MODULE_ADDR, > + 1, &udev); > + if (ret) > + return MV_ERROR; > > /* SERDES module (only PEX model is supported now) */ > - ret = i2c_read(MV_BOARD_PEX_MODULE_ADDR, 0, 1, (u8 *)&val, 1); > + ret = dm_i2c_read(udev, 0, &val, 1); > if (ret) > return MV_ERROR; > > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de