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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F32E4C43334 for ; Sun, 19 Jun 2022 11:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MbwQ+JWfZ+ANUEmuLnIvGqfd++5RJeRjkGzV/1HPuiM=; b=KC3YU52UN8c7dL /zHTSKEWNbrBAGvvfLvDSat9QWhFTCvsxMfsUVP0yKfc9oChXl+UzfVQ8XzFW35p3Fwo3J3ns+fiR +eUtP4Dqz0KE6kDRyKrO+6tmPQUE9b7YwncFlfFDxIsVgIjyixpkNsxZ0AWqtWDR88XGDnz8p3xBh 0D816/sRPc1dBJ8P+IaS8NeMWMwALJ+qJ3C7Txh9WsTQ5oLR3Vt/PJacInKPGVFct7EZT3Ba/hrOJ w7J78b7EZm71PupjnKBlIhXDrEl0IuLuDmwKz4U1RTfErO0FFMDIQ9qjRWbWtiyDA6XWnUDLoUBrp 2euA2bU+2Pf5SylTMuHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2tCi-00E0nL-Ac; Sun, 19 Jun 2022 11:34:56 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o2tCc-00E0ll-W1 for linux-arm-kernel@lists.infradead.org; Sun, 19 Jun 2022 11:34:55 +0000 Received: by mail-ej1-x635.google.com with SMTP id hj18so15625421ejb.0 for ; Sun, 19 Jun 2022 04:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=utuT6cM/eVUrce22kFa8LNAWsGwMTCB+s3XUZ2ZFqjM=; b=mXgpt+1B6pqO42lHUT4jA1tBiM52Ug3Jpsxo+tK8ynedBHMa0VbC/QlOY/k4MQWMIL sZ09fZTms2b0ER5ORbUV+AX0NpK9/vcWO6oxJlfxH6/poht8DdvaFuHJGhHEaQtJsE1P OcwbY/e+e2vNcoQeajDAVuJh4IYmXG2JL0WOvgETVXPqR7IcYrGQzerGpV/X0B9bhIw+ iMuN8X4ElDnEYoEBQUr5TUkYPfadYvNEmbfNJL/1SzKuJSSRoLDx2bl3NNAk6ghs/cRs 7HoejQdHbldmsGCRLJrfObwS8N7DKAUIfrzn1imoD3QRQbik5i3O0P4KqtqbfhZvYM5j d/8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=utuT6cM/eVUrce22kFa8LNAWsGwMTCB+s3XUZ2ZFqjM=; b=3RiHdMubeBZcXml7HfP7VQwfjpue8H4wfA9IHeP0VTqb352/4pKKbnJgn7vkRlrafv u++NfGsSyJP9ETvrxKQ/GlT7JVqMF4j8oXOsHPtYlgl5ATn0WVHtxDnGU55APwwtTQXT /C27nfDBjqAV62AvBI5zBM0xASrZLkn6HACgvctit4Ds8OEgIyk1qe+kLeh8ELOk8BET GAcAwl75yrfH20H+rC/rBVsgyQ5rU+rezSszfd7ufWruiH89aasYVTe4nCR+FcasGTRh rSIivByS8NoPiQWXKTp0F7z+Rg8/V054hCVt//rMYE91CXpeq2vdLdgib/xkgqNhro4P x1dQ== X-Gm-Message-State: AJIora8Q0BO2vlAb9Ko44x+u8YKTRSoeZVHB3dxTDDhB1WCzSjSkFddM pKv3qQM7Gnjzdqgyoe8G9b/WGqVj9F4I0qQ1V7Rg8alJANs= X-Google-Smtp-Source: AGRyM1tCsOw9ij3ODqUgP7h7NTNnUNkfZS+idLN4MZUsf44yfptBhZ7vjHap3gjfMwCJ8VWkccJjC7/adSSxTpLE/88= X-Received: by 2002:a17:906:149:b0:711:fca6:bc2f with SMTP id 9-20020a170906014900b00711fca6bc2fmr16875033ejh.497.1655638489111; Sun, 19 Jun 2022 04:34:49 -0700 (PDT) MIME-Version: 1.0 References: <20220618165747.55709-1-samuel@sholland.org> <20220618165747.55709-4-samuel@sholland.org> In-Reply-To: <20220618165747.55709-4-samuel@sholland.org> From: Andy Shevchenko Date: Sun, 19 Jun 2022 13:34:12 +0200 Message-ID: Subject: Re: [PATCH v4 3/4] Input: pinephone-keyboard - Support the proxied I2C bus To: Samuel Holland Cc: Dmitry Torokhov , linux-input , Linux Kernel Mailing List , Rob Herring , Ondrej Jirman , Krzysztof Kozlowski , devicetree , Andy Shevchenko , Chen-Yu Tsai , Colin Ian King , David Gow , Jernej Skrabec , Krzysztof Kozlowski , Marco Felsch , Mattijs Korpershoek , Stephen Boyd , Yassine Oudjana , "fengping.yu" , linux-arm Mailing List , linux-sunxi@lists.linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220619_043451_113830_3EB2D143 X-CRM114-Status: GOOD ( 15.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Jun 18, 2022 at 7:12 PM Samuel Holland wrote: > > The PinePhone keyboard case contains a battery managed by an integrated > power bank IC. The power bank IC communicates over I2C, and the keyboard > MCU firmware provides an interface to read and write its registers. > Let's use this interface to implement a SMBus adapter, so we can reuse > the driver for the power bank IC. ... > + /* Read back the command status until it passes or fails. */ > + do { > + usleep_range(300, 500); > + ret = i2c_smbus_read_byte_data(client, PPKB_SYS_COMMAND); > + } while (ret == buf[2]); > + if (ret < 0) > + return ret; > + /* Commands return 0x00 on success and 0xff on failure. */ > + if (ret) > + return -EIO; Something to use from iopoll.h ? -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel