Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4388842ioa; Wed, 27 Apr 2022 02:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVvOL+TEN0qGFcoIW+6FAQQ0APIUJfBf6+2gq/6ztEW6Vb2vF/mrpRJK5HWrRadWg45FAf X-Received: by 2002:a63:82c2:0:b0:3ab:5747:8837 with SMTP id w185-20020a6382c2000000b003ab57478837mr11248427pgd.297.1651052690732; Wed, 27 Apr 2022 02:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651052690; cv=none; d=google.com; s=arc-20160816; b=oDMVb9laBInP6WfkWiePZxfF81sjlfuTpwLAwnEKz+xaAlQZ9ak5Nt7rYqHwLPIdWK D9LUFHI7FZ7z8/cgA7HNWreN/eYW2PeKMLtuiaoPcAT2GroibtFrRah0ZNOwFZRT8chv hmS7JRNf7gFNv268TDg81p8YnYTH8AS4bW4cSlyXjrSoJdMv1faZR0Alb/wF3FeApR20 Xvh3GWWxTWH8NOOnTmL8T0tIbmynxReUIN9K4h8ZRPyH1zJpLyHUqolpP3yD35E/ZKLp 4bp1Ul9bdnNqVHGF3kg5B9RNU3hYdVnRNe59cIKxhDdXFbDF0aUCdVvbM+ABMIxSoeaT jxFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=148jFu4vUCQc2QLeI9K9LkjZ6LtP5qMTePgcRbLOra4=; b=Au5WcRZ+iEyAYSFFNh6xZC943i44chyNW+seXlv7dRyd9Me4jcZMh8ljcSvrxLy6Fl O3DFrcRYJngpD80V4thA+V8GJnxol1sfRUo2GGS7d7heY/Jfa7G1wKav8Hr541EMNPZT H3ggBbFKHHYl173LXj2AbYJ6YAODXTh+VDxsggga7aUCDRdcZRN+7YciQGruAaDCWJgC QzvCPdHwGvdee0zCWvcRz5K7C90WBy5Uf8zBGuyESltvjvhkVNuqBGrKnbfz6IZBaudJ 6D/Ez4gqrIKH044gJ2RLYD2qnvEY8sJi0r7AafeTKKQlox+gv8zbKc3McFBhJ0XNAHxl cE/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i4igcz0N; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o4-20020a17090a744400b001d9a2c30f5bsi4576648pjk.58.2022.04.27.02.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:44:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i4igcz0N; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78811284DAD; Wed, 27 Apr 2022 02:19:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358225AbiD0Gpk (ORCPT + 99 others); Wed, 27 Apr 2022 02:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242894AbiD0Gpi (ORCPT ); Wed, 27 Apr 2022 02:45:38 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF2D12FEF4; Tue, 26 Apr 2022 23:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651041748; x=1682577748; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=M0Yim+wzgXBIfpDKLfu6Nj6r7PJaxMbByiW4szopul4=; b=i4igcz0NYHy0hwhxIfrJgTimlFEve1b9tZUqr02Q/EB8twoBfh1amCPT eimuG/X8PAmxsIn4yibSc0jmT11VvoDcctHIj4PeaLHdeVBJTaZIBMTOC PX7YO9eq/Po58t+WBFGfeFOBCFt0Bpiw0f5eoUyUcIPw0gVD7jxRxuO9i JlbbMDvETY68qo+kXcAiFRlybRaNc+5yTj/SbVqF4U1qLPS7Ovw+Izg9s CS4e9HnZdnBguhOKg7CBeLNpT1MTkEoy7mzPRnhc+HA7UFXFjrl8DWm0F p6Y1lHqsE4r8Brw81Gt8NoYbiwN1rwMEuwD9nJ6+CVzGZMTGjZX3Vo/gF A==; X-IronPort-AV: E=McAfee;i="6400,9594,10329"; a="265644130" X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="265644130" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 23:42:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="705407344" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 26 Apr 2022 23:42:20 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 27 Apr 2022 09:42:19 +0300 Date: Wed, 27 Apr 2022 09:42:19 +0300 From: Heikki Krogerus To: Greg Kroah-Hartman Cc: Benson Leung , Prashant Malani , Jameson Thies , "Regupathy, Rajaram" , Guenter Roeck , Won Chung , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] usb: typec: Separate USB Power Delivery from USB Type-C Message-ID: References: <20220425124946.13064-1-heikki.krogerus@linux.intel.com> <20220425124946.13064-2-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Apr 26, 2022 at 02:07:25PM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 25, 2022 at 03:49:44PM +0300, Heikki Krogerus wrote: > > --- /dev/null > > +++ b/drivers/usb/typec/pd.h > > @@ -0,0 +1,30 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > + > > +#ifndef __USB_POWER_DELIVERY__ > > +#define __USB_POWER_DELIVERY__ > > + > > +#include > > Why kobject.h when: Oops, that should now be "#include ". > > + > > +struct pd_capabilities { > > + struct device dev; > > This is a device? > > > + struct pd *pd; > > + enum typec_role role; > > +}; > > + > > +struct pd { > > + struct device dev; > > + int id; > > + > > + u16 revision; /* 0300H = "3.0" */ > > So BCD? Yes. > > + u16 version; > > +}; > > > + > > +#define to_pd_capabilities(o) container_of(o, struct pd_capabilities, dev) > > +#define to_pd(o) container_of(o, struct pd, dev) > > + > > +struct pd *pd_find(const char *name); > > "struct pd" is just about the shortest structure name I've seen in the > kernel so far. How about using some more letters? :) Okay, I'll make it usbpd. > > + > > +int pd_init(void); > > +void pd_exit(void); > > The kobject question above goes to the code as well. You are creating a > bunch of raw kobjects still, why? This should all fit into the driver > model and kobjects shouldn't be needed. Are you trying to nest too deep > in the attributes? If so, kobjects will not work as userspace tools > will not realize they are there and are attributes at all. They are not raw kobjects, they are all devices now. That header just needs to be fixed. Br, -- heikki