Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp228160rdb; Thu, 1 Feb 2024 07:03:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIr7o/27GZCRYCOSJf6YNtoImb2sqr768yVAxtU3wa4pWqbd5crK3VSTNbPktH2vZagIQX X-Received: by 2002:a25:2e4a:0:b0:dc6:ad45:3c51 with SMTP id b10-20020a252e4a000000b00dc6ad453c51mr5089452ybn.36.1706799803007; Thu, 01 Feb 2024 07:03:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706799802; cv=pass; d=google.com; s=arc-20160816; b=ipK+3d6nNZ4lcyP+L7duO92a5CPDZfTD0GzpQ5rF+zXb6jpe9XBkBTqD/pYpy/8z1O mb2YZ7AoOb9rfWdK9lKyv1SRwnBohai8PBS2J9CINWzYkomIOPR5xa51FMk0nyppqx+n DOOY4QMFV0XrXBgKRNH/e8WIxHQEUPx3k6/aKVgXG83vHCf7KGavgqwc1TUv+uzdSe0f DHQNIp3hkO07k2y+H/yLqg4fpgnVrcRv7eebawqP7Vqy+7X51df55zTmnIh1EcEXLmRD +Rny51ElNXSm4ZoPEUMG5Nd/iVEuVFv1GHwiOKeTR1GsrV6Mqvp4a/E0C1/51lt/87Lk pi/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1AobetHnahaPxTouE1VVH1r1FYZqktwNq5Ck7+S9JEQ=; fh=ABDhg7euBgii2DNLuBIrYWS5K7wyHJf8VYpSMlGKX9g=; b=SNCc/7yu7XpWCmBPCFrReTrDTBDop48SybYMc/045ORhax2YBMxNJd3h92LVdIC6aN QytOt4ivafoDce1Ljyxf6z3ys8D1Cn19q3rveB8WPgB22g0mJM8JespOMPrNYj97HZzQ JFrW6jf7ZmTDpbIT7KTlrtpNX/nDm4p+DrNbpL2Vxc8xwiJOBEu0H6cyBaoN9D867HJi 9VqdwdDNw/pQn0DgUmgmKRPyDTupNmg5Qz0W3DjYBiIgeMhBP1oEiDi91JWFlwJv/9dz UU5RpvWE1dAS83G/kHI1DBzaFQnpkR9tePeCKCuhn1v28l9u+aWr24yGtVAGOFDhn2Ry SSkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H2ajoABc; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-48350-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org X-Forwarded-Encrypted: i=1; AJvYcCX/CIJLfme1XzZbFDedXBKWEE1FvVUJFVOUt3e5dcdftqqge2Tboj0tv6h5jq8szM/iNMZPsdhUYNUSqy23LaCubmTCZea9VOI72nHCww== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u4-20020a25c404000000b00dc24da581f4si6963300ybf.165.2024.02.01.07.03.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 07:03:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48350-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H2ajoABc; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-48350-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EDB1428B225 for ; Thu, 1 Feb 2024 15:00:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01D7C5F49C; Thu, 1 Feb 2024 15:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="H2ajoABc" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 272D05CDF8; Thu, 1 Feb 2024 15:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706799647; cv=none; b=ICxsMxP40S97C7Dmf6VD3RJYq9xZ8vwnIyBAawfg6ZKxv6xxhP3w1p7j6kbvo1Rxz0EF/Ok2UN2RescOoNBNVHeBJp9qvyQI/6jFBv+654QSwMR2mI3bUhXztLAbRXQIjSdI3YBZjOlhzxNHnTIRyRE3IVwnasNuX5+6egpgZ48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706799647; c=relaxed/simple; bh=XHfskHspmfYJuhvD8hh+5pmEbJ+2xIhYyQSuomUDNtU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eO/ZIfxYu+RzXNVoXzJJnJllX7mekqtG00D2omKXQCW8PWx1i8hCzPiM/BaBknaw+yFEO/ZoXpbFq/KiimxB65YmoKC9wFsOix+IV/O31T4t5U2aJAduQEDkngsca+Zyl3PtZseyNaE/CRA6PO1yBaDbVqHBmShLPl1iWcIIDgY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=H2ajoABc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 946D0C433C7; Thu, 1 Feb 2024 15:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706799646; bh=XHfskHspmfYJuhvD8hh+5pmEbJ+2xIhYyQSuomUDNtU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H2ajoABcYubKrIdEleS5/7jOZk4Loau492H6Swd6yTqTTQsKC7RzraOlr1H3+fqMw kW/Z56aCWlTxkQj/rH3tErFw833VrC+RnDLKIMGZsMpCt7iYQuz7GaiOdDfhyP+t4T 1t3/was8W0cBOJiUrZRv4dq/z/Va9Bf+1ebYbRUc= Date: Thu, 1 Feb 2024 07:00:45 -0800 From: Greg KH To: Pavel Machek Cc: phone-devel@vger.kernel.org, kernel list , fiona.klute@gmx.de, martijn@brixit.nl, megi@xff.cz, samuel@sholland.org, heikki.krogerus@linux.intel.com, linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: typec: anx7688: Add driver for ANX7688 USB-C HDMI bridge Message-ID: <2024020118-zesty-enticing-b7b3@gregkh> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Feb 01, 2024 at 11:41:56AM +0100, Pavel Machek wrote: > +#define DEBUG Please don't. This is dynamic, use the dynamic debugging and set it from userspace if you want to debug the driver. > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +/* firmware regs */ > + > +#define ANX7688_REG_VBUS_OFF_DELAY_TIME 0x22 > +#define ANX7688_REG_FEATURE_CTRL 0x27 > +#define ANX7688_REG_EEPROM_LOAD_STATUS1 0x11 > +#define ANX7688_REG_EEPROM_LOAD_STATUS0 0x12 > +#define ANX7688_REG_FW_VERSION1 0x15 > +#define ANX7688_REG_FW_VERSION0 0x16 > + > +#define ANX7688_EEPROM_FW_LOADED 0x01 Mix of tabs and spaces, please just use tabs. > +static const char * const anx7688_supply_names[] = { > + "avdd33", > + "avdd18", > + "dvdd18", > + "avdd10", > + "dvdd10", > + "i2c", > + "hdmi_vt", > + > + "vconn", // power for VCONN1/VCONN2 switches > + "vbus", // vbus power > +}; Again, tabs vs. spaces, please use checkpatch. > +#define ANX7688_NUM_SUPPLIES ARRAY_SIZE(anx7688_supply_names) > +#define ANX7688_NUM_ALWAYS_ON_SUPPLIES (ANX7688_NUM_SUPPLIES - 1) > + > +#define ANX7688_I2C_INDEX (ANX7688_NUM_SUPPLIES - 4) > +#define ANX7688_VCONN_INDEX (ANX7688_NUM_SUPPLIES - 2) > +#define ANX7688_VBUS_INDEX (ANX7688_NUM_SUPPLIES - 1) > + > +enum { > + ANX7688_F_POWERED, > + ANX7688_F_CONNECTED, > + ANX7688_F_FW_FAILED, > + ANX7688_F_PWRSUPPLY_CHANGE, > + ANX7688_F_CURRENT_UPDATE, > +}; > + > +struct anx7688 { > + struct device *dev; > + struct i2c_client *client; > + struct i2c_client *client_tcpc; > + struct regulator_bulk_data supplies[ANX7688_NUM_SUPPLIES]; > + struct power_supply *vbus_in_supply; > + struct notifier_block vbus_in_nb; > + int input_current_limit; // mA > + struct gpio_desc *gpio_enable; > + struct gpio_desc *gpio_reset; > + struct gpio_desc *gpio_cabledet; I'm stopping here, again, tabs, you know this :( greg k-h