Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3713393pxt; Tue, 10 Aug 2021 09:37:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjnIQvaXv6ZbswFZI0gvgnHoDgSbKBISYQlCrMmhVVakDG8XjpWVOmywvNR+Da2ie8VCce X-Received: by 2002:a6b:440d:: with SMTP id r13mr1268316ioa.1.1628613437876; Tue, 10 Aug 2021 09:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628613437; cv=none; d=google.com; s=arc-20160816; b=k9Ywj/tPJabTxBo2N5LtSgBX0+sKuzf30UbrvppFjbAUaZ50dfv56Al3/mUpE6nZ0C 4UIOm75CI3G7hwagWg5EuTM/aSDU91ia+TMgzFNwhfFSolCovzL9nhugdXaZIwHoBMZi f2y7haa55OGmwotxJP8X2iHs1mT6j3iWEV5dUh9kJ2WAbtKOExilR66VCCP9tlK6jLne sE8jpaF+qy+sdgPY9vglVO+2lpZaI0HlQFV9XKbJO3XJYfqIXZ7ddZBqnoZ7KEl8D1I6 wj8jCgTZMvsvdx2vjRv8zAz/TSB2ogZgXcBgVJOUl5pD4P5AFr7evDYONzFsRbqdVEFb Qtqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tQ9djM8Tzt2DqRTr0Ac9cV4rkPFXLMY1XtXmewIg/CM=; b=huksJ7Tphekz1D4Q69LVcIAF5Ipbsu1UhyjiPvKFZUFBFev8inTj953tXCaMghW4na ZCcWF7s3fFvQoovCqtUbZd6JqYl/5bd/lTHpSlR1V9HjYTX9RY7SWgIY8/rSVMz8ZzO/ wYtwuJSlqY3eTfpFx9te8y7D4pV6aYAu0JmMI+NENjTf4dQntUboAweHioa2cly387+K 7xggYWyQZHB7jQ5COPBIEd8dBIFlBynAhhdmPX30I4TA0HN82UauSr2CzguhIsTDdHy/ V1DcQsIVJhB7s6c2321jwM0ifR3NKVQV39/shXFY9zaDdl+/2Eowu7N6dcX7wuJKe4CV CZNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pm5OtXw3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si11727382jal.44.2021.08.10.09.37.07; Tue, 10 Aug 2021 09:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pm5OtXw3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242176AbhHJONi (ORCPT + 99 others); Tue, 10 Aug 2021 10:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240474AbhHJONh (ORCPT ); Tue, 10 Aug 2021 10:13:37 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E8EBC0613C1; Tue, 10 Aug 2021 07:13:15 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id x27so19139309lfu.5; Tue, 10 Aug 2021 07:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tQ9djM8Tzt2DqRTr0Ac9cV4rkPFXLMY1XtXmewIg/CM=; b=pm5OtXw3zU2t/eI3uwo88dLJRmQSC5LPfztxKtRQ4lAZn1PTaztvFcIlMDQ399PoUM 3v76ZG0lY0LgoD3rsEJsRpwKD4nqP17ofL+SZHJJHPYeZ2Z2/xtKRzPU1scoZ+iVxE5j nX8XgnP0vT+Dg2Fn5usNbfjL9HCiG7RpUzy3DDpo0SVdwFMgh5si2bwiMrG5nFqotEEE uYxvT2TlijQ6qAurDm55aBPiCVcpMgZPkbYvYVuP+Kz/EILRs4Z3BYcYjzL2AZx89eJs mR5EQhSP0rLCHaTIeOGcFZ1IkZxa7aT+lDI27nyMynl9MX9XUQn2JKXpQCNd77WrgbCx 1Cow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tQ9djM8Tzt2DqRTr0Ac9cV4rkPFXLMY1XtXmewIg/CM=; b=erqC52FAP+FgtGmoU1Ld/XkORENodoI4cGvb1gu8elWNeMgukCxYeXOMmSe+qFYq3P q2yHZ71CfX9Wy80+6KcZo3cmPFv2o9XLR5ECD3vJwK69l5nBWBXF86J+eoiFWjELnY0T 1CCItOmAKkK7iZTukq1Rg2xR80PfaAhkKEFYYN4mnntkYqh+R6h7CofHE5FTY0dupIaY 9OUmqMsMGQvVNoC0C1eUHWCRrijaCw2SJpZ3oJOuus95UIiDV0xj1/T8KjplTIimwjFO 6CCRnqMn22HJKtFnl7JYVAPGjb4Ab/jpzG6KfcI/Vn2fCUi4NCI66BUDYnjDYQdiD0Oq KDOA== X-Gm-Message-State: AOAM533wD1umB6ViMkOCNblVrH7ABP8bFi6topan9CojZCY2zLg0OiXy tYQZsg/BUJTu18F3m7h2ds93sW8Nu0z1o5b9AC0= X-Received: by 2002:a05:6512:3b07:: with SMTP id f7mr23846052lfv.398.1628604793544; Tue, 10 Aug 2021 07:13:13 -0700 (PDT) MIME-Version: 1.0 References: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> In-Reply-To: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> From: Muni Sekhar Date: Tue, 10 Aug 2021 19:43:02 +0530 Message-ID: Subject: Re: read() via USB bus To: Oliver Neukum Cc: kernelnewbies , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 9, 2021 at 1:45 PM Oliver Neukum wrote: > > > On 09.08.21 09:58, Muni Sekhar wrote: > > Hi all, > > > > PCIe memory mapped registers can be read via readb(), readw(), readl() > > kernel API's. Similarly what are the kernel API to read the device > > registers via USB bus > > > > Hi, > > I am afraid this is based on a fundamental misunderstanding on how > USB works. It is based on passing messages, not reading and writing > registers. I am referring to the code mentioned in https://patchwork.kernel.org/project/linux-arm-msm/patch/1534464348-8227-3-= git-send-email-pheragu@codeaurora.org/ As per this driver gets access to the Qcomm=E2=80=99s USB h/w device regist= ers via devm_extcon_dev_allocate(), devm_extcon_dev_register(), platform_get_resource() and devm_ioremap_resource API=E2=80=99s. What does the USB external connector EXTCON_USB \ EXTCON_USB_HOST devices means? Are these different from normal USB devices? > > USB devices are primarily based on endpoints, not registers. A literal > answer to your question would point you to the clear/set/get_feature > standard requests of chapter 9 of the specification, but that really > will not help you, as you are making assumption that fundamentally > do not apply. > > I hope this list stays friendly to newcomers and we will answer > specific questions, but at this point I must advise you to first > read an introductory book. > > HTH > Oliver > > --=20 Thanks, Sekhar