Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1584359rdb; Wed, 31 Jan 2024 03:14:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHN+Mn/tI5c7obHHSBmze9Dahx9J8pvQTtppSaoplEKf9oy8WWxs6Kixv5Lcnj5D4+p48s9 X-Received: by 2002:a05:6358:71b:b0:178:7d98:f7ab with SMTP id e27-20020a056358071b00b001787d98f7abmr1136965rwj.15.1706699694245; Wed, 31 Jan 2024 03:14:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706699694; cv=pass; d=google.com; s=arc-20160816; b=qsS1P8VQtrr1G35FRrFiERg3uCmaBjEYgRhNNjU4Auvzg2WqUkPTwC39HZwmpgp+xH lASdJbqiPNRvlkaxhzHekE2gTyGAgm6LnMSq/K9Q1D+bvamRtn8oBtIIFSJ1ah/aXzu1 41IHeeIH7lQqvL1n2VNMdPzn6z+07w9SMdCgOBZKdH5x2cFBPTePbFnHdtWew30145I3 MRhVMe4q3b8bVXIljNdF7USZ0CQwHntSentB48SDZeq5kOO6d98GFHy0a9TrD3bwVLbC UYIgMCxI1iDKikuKw94HgYP7ZpJKxEqFfm2OHWE3DnsM8TGR0PwoKLy+t2AGAUELJUkd Ggug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=btCZOsBzbw9dkusU2J5SWh6K2ra1mwtZQn2thXH7Aog=; fh=2gyn4o81t34Plfh6FuBWIcxAb6nTsrlRalvYtpNUKUA=; b=dmmX3yhRcqt8OIeH0re9VoAzs+sG3/MfEyPg5hnEl/F4DYR6BNN5r9j+IrLJMZ1hLc XsABsWSGEyqz0TpG+NO2p1Dx6dqRWxst5f0qZaD3MqmsQwXwaeNGNJ0lOmnKqUejDPPH jC4GHQoylSjE6jxpbF8Dap8QokwAvglqC/x1o4VeyXiC4LOkyA0S/PFYNqWI5cJTbAbn vc2UWlwifzb7qGqEA/gDK9zzKPwnxzfx+zGGZ8j0+fu9y8pdmpygsxTJyBV9yK7wis/L xhu6+HunfunV2xWWSAmV1TfEWTTf5CJ8hKB5eklTnWSyB8P3c9Q8oJDX+Z+J0x4USryk TQog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SDj5lO2y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-46302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46302-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVDXHdxXUqT0WNeodAS6hItHzdStkWcvtP7AAO2bQxhjLN66NE4qJ3rpwllqs6z2VX1g/kDYMxI4fQe153ewsKwA/Myk0ofql5tITRs4w== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ck15-20020a17090afe0f00b00290eec87a13si957910pjb.17.2024.01.31.03.14.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 03:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SDj5lO2y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-46302-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46302-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 5D6EB28E6AF for ; Wed, 31 Jan 2024 11:05:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 280F27993A; Wed, 31 Jan 2024 11:03:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SDj5lO2y" 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 3E9E978668; Wed, 31 Jan 2024 11:03:17 +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=1706698997; cv=none; b=B7zcySlfimTUkQ8TV0LCDnlAfGU90K/7y/fnZ/eryA1779aT5kdyhSeqN/azEchXuO5yV4a3aM0wmC2ft9zUPFilPnPRtvHm8ubKV6/7NHLOw8aZhSp1SU6I9sSH/HdFgTvCHVgIHHD+xn7pD1mYsf20iU3TzKgfKYnR5AFKEtk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706698997; c=relaxed/simple; bh=wz8mZeMJ4lXkzfi7C4k08g/FeXlGD7xz3n4JSrz6JM0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PVwOE9D7BIY8CTQjF6u1KRyKQDaim6Am+t/qw+sD5821LYBWPiRwuxnoXKDvBClorZMyBsn61h7vaJXOzaqUh2JGfEZzEnZHAjPmWi12PzyYjm4knkEXPqRMTtSI/Sb0Du0HUScf3P4I8zlFI/yYHLvJc9nN0q3cetCibn61Y9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SDj5lO2y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AD09C433F1; Wed, 31 Jan 2024 11:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706698997; bh=wz8mZeMJ4lXkzfi7C4k08g/FeXlGD7xz3n4JSrz6JM0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SDj5lO2yzopiyTwlLyrOIyt/IcDQW50EfY9T4oLgxD6kWFpEVVfwxHBNfDHfQ6lpu kMnirpZfHTX425I0j/MEXYwhu7m5QtjeA+RTZnJl6BGgPnwgn51W5nS8n6GSjrD6JF NiRIp8+Lj+10XqHrQUmq+JdQvpz57RnfqzgLAZ3dnvvaiUyAIcaAGDn8dZylaTVmmW wN1aX0/visHzvJL4U8eRjHJ86HjrQt1AuGIBF2GRiQlnPebJ9IA+T+JuMD9Fg2NxPI 5zB966/YiXtEUv9UElq7jUKfE4zQn+FCdtkrKH/IFPzLwZoL6VDfY6oMwGNJOJNYsX um8hvs7GgY+bg== Date: Wed, 31 Jan 2024 11:03:11 +0000 From: Lee Jones To: Karel Balej Cc: Karel Balej , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Duje =?utf-8?Q?Mihanovi=C4=87?= , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Subject: Re: [RFC PATCH 2/5] mfd: add 88pm88x driver Message-ID: <20240131110311.GI8551@google.com> References: <20231217131838.7569-1-karelb@gimli.ms.mff.cuni.cz> <20231217131838.7569-3-karelb@gimli.ms.mff.cuni.cz> <20240125122634.GE74950@google.com> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sun, 28 Jan 2024, Karel Balej wrote: > > > + /* GPIO1: DVC, GPIO0: input */ > > > + REG_SEQ0(PM88X_REG_GPIO_CTRL1, 0x40), > > > > Shouldn't you set these up using Pintrl? > > You mean to add a new MFD cell for the pins and write the respective > driver? The downstream implementation has no such thing so I'm not sure > if I would be able to do that from scratch. This is not a Pinctrl driver. Isn't there a generic API you can use? > > > + /* GPIO2: input */ > > > + REG_SEQ0(PM88X_REG_GPIO_CTRL2, 0x00), > > > + /* DVC2, DVC1 */ > > > > Please unify all of the comments. > > > > They all use a different structure. > > > > > + REG_SEQ0(PM88X_REG_GPIO_CTRL3, 0x44), > > > + /* GPIO5V_1:input, GPIO5V_2: input */ > > > + REG_SEQ0(PM88X_REG_GPIO_CTRL4, 0x00), > > > + /* output 32 kHz from XO */ > > > + REG_SEQ0(PM88X_REG_AON_CTRL2, 0x2a), > > > + /* OSC_FREERUN = 1, to lock FLL */ > > > + REG_SEQ0(PM88X_REG_BK_OSC_CTRL1, 0x0f), > > > + /* XO_LJ = 1, enable low jitter for 32 kHz */ > > > + REG_SEQ0(PM88X_REG_LOWPOWER2, 0x20), > > > + /* OV_VSYS and UV_VSYS1 comparators on VSYS disabled, VSYS_OVER_TH : 5.6V */ > > > + REG_SEQ0(PM88X_REG_LOWPOWER4, 0xc8), > > > + /* set the duty cycle of charger DC/DC to max */ > > > + REG_SEQ0(PM88X_REG_BK_OSC_CTRL3, 0xc0), > > > > These all looks like they should be handled in their respective drivers? > > > > "patch"ing these in seems like a hack. > > To be honest, I don't really know why these are required and what effect > they have -- the comments above taken from the downstream version are > the only thing I have to go by. I might try removing them to see if > there is any noticable change and whether they could be added only later > with the respective drivers. If you don't know that they are or what they do and you haven't tested them, they should not be submitted upstream. > > > +static struct mfd_cell pm88x_devs[] = { > > > + { > > > + .name = "88pm88x-onkey", > > > + .num_resources = ARRAY_SIZE(onkey_resources), > > > + .resources = onkey_resources, > > > + .id = -1, > > > + }, > > > +}; > > > > It's not an MFD if it only supports a single device. > > As I have noted above with respect to the IRQ enum and also in the > commit message, I have so far only added the parts which there is > already use for. I intend to add the other parts along with the > respective subdevice drivers, please see my regulator series [1] for an > example. > > I thought this approach would make for shorter and simpler patches and > also would allow me to make more informed decisions as I familiarize > myself with the downstream subdevice drivers more closely one by one. One device doesn't warrant an MFD. Please add more devices. -- Lee Jones [李琼斯]