Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp388851lqh; Sat, 4 May 2024 05:37:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXl8E9qTwsXe0ig59PDIr41nL92BseOAeA+ghHXfDTCxqtyW3L9sN7EA46nvCcPIr8fym1GaRlElU4JM1OsNNfik8d6r2UsKbr++5Elsw== X-Google-Smtp-Source: AGHT+IEnPPyn9sWdp1jAtdh4jlqXDSrk9cPS4PfGeSf2ZJ4tEN+HbdvrYZ9NBhLr0BVhd4MY1WUN X-Received: by 2002:ac8:59cc:0:b0:43a:7660:2114 with SMTP id f12-20020ac859cc000000b0043a76602114mr5282946qtf.6.1714826264386; Sat, 04 May 2024 05:37:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714826264; cv=pass; d=google.com; s=arc-20160816; b=HgXW6KobiYAEHE2dw58Y1rCoumI36Kv6XwGddTx1jjtOzM8jmKGPCsuUf+guxn3KKx RyFzhgeiZwIFJgU3+yqTU6mHzHWOE27GHRkWR4d74kvJM/Om/SPFlsFVwrtq7yc0CN0I ugYvwF3FMjeWCoGMm2BhpDVeFbFGWbjX8BuuZxTjyA2ErK3HjM7H6J0Xw3LgBR7xciCU H3/kuLVYNlCi5EhKBoiBd3ifTtinHb7VABvCEKb7IaqCTK2JnLdzjutdv1FriT8Xdcie 3p9d/ZObE+WqZkeQwQtQPOHXgm4rrOc+WKeaec+na7wRH1YLaKsBQzZEttZT2bUgGCTu PxxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RRwc+lUgatgKkH+J/KfgoQ4NgMWwebsVYOb/e8b2HU8=; fh=T5jfgs5ayWQUXxC96N1fGZlb6TkozN5FMLYOP6M+0Zo=; b=BruzZxIuDUGfUMk1NGWSG68/f9D7endngCW4cNOln7DNjkJ/fDrIxaApsqLFxo33N0 RlnHkZAAr2yiJUL6ByX+jeQ7MfExhQdEg5RYznzxyHucC6ZTpf5Tus97DkC4jAi8RvW3 uCD2NjaS/qCJzPhoDXJQt1KBcdKF5Dh8X5Qw5jOHTiLBOIuZPQXhtYlCjknkSTGKhvo4 G2OKkvTq3jTJ29olZBtdz7XkjrWRiNa1OGVew7LFfh8yAdegW3kCOYLN0YI2gQ7cu3rw uitxeqxQknVAr6rT6Ybe8r6jutKUE3S0iMCyaZk6a2XrmatSwWq2iWOQlBg7kIyDxw5L JyeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KqdkxJA9; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-168649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bp39-20020a05622a1ba700b0043aee2fb39bsi5653991qtb.445.2024.05.04.05.37.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 05:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KqdkxJA9; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-168649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E8D141C210BF for ; Sat, 4 May 2024 12:37:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B821222331; Sat, 4 May 2024 12:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KqdkxJA9" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21DAB4A1C for ; Sat, 4 May 2024 12:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714826256; cv=none; b=ezYyCFlQ5I2aesnlFi4NxgyNOkgCS+9ewzdX2HBT2utWCGJWx6v1ESvAEkG1MfCY8D6Ihaac1FiQFFnWR+B5oPU1qE//12mM6TXgZuBezdLJYKl4IftBEzL/ILKN4RdcLZaPbNrU9uLqMNyyrlEqV3Fw9M0HkSy5qEHe81TGk0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714826256; c=relaxed/simple; bh=hNMW8+IgLuSBkd4py+ntrpJEGZ+dxKnzAjLWBbDqbdE=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=Bjtai4I4YX/9SQmLFwzVHtHEyR2zje2YqyA47UFBWAN55+XkyEle9fKxcCednV8fCuMj2+2xvaVgKPD3nSGny+HbqJYS1LHhhA4noq23qfkdWNtU3In0qsW3Ge6DSPde0Fo4MIpw3eXgHvs++PTRD5WYOjHZM8lAhPlSBVDwWBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=KqdkxJA9; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a598e483ad1so105877566b.1 for ; Sat, 04 May 2024 05:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714826252; x=1715431052; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RRwc+lUgatgKkH+J/KfgoQ4NgMWwebsVYOb/e8b2HU8=; b=KqdkxJA9BhPS+0i0BRP0loR8Kz58p+L9L4zbwOBxs6s0w50XPtGAUVdEFDMqbLLWM2 J9jWlz5PvJ/hhXi1bFyl7JKPde+2pqOGG4mRz9m5UEoIGlS0VgjLYBPfw39+pzp/zBj2 28nDhsEBQNdVPcS0sItl7lqp6B1YCsysyB40XIawGGMItUrGkjGA9A3kUiGokuFYPSsm f4wPR6HTN3OezzdIF7YinMMA3HU9mU/zs57D0HDEo2n1c5ZPf6OU5TbrjsJXZWWWUvF3 FoFrNJ1E7lahcUr2Lo9bHCZ3inr67VOILnbSm76nFKLXNL7dwfZAoHnakDi6bpMj5/h2 nZ7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714826252; x=1715431052; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RRwc+lUgatgKkH+J/KfgoQ4NgMWwebsVYOb/e8b2HU8=; b=rgt6xmXBmHbh+Q2AMAq68QtG+QBEZ8nXriN09zMjak+yUCFUD6G5eNbP4uTqAeOglW BgMg8s9PMwtwHHNEgKd9JKOYzF5KBZNrpG23RdFJIvLRe+xYD2Z2ZxRk6nx5Vhnqw6jH znvKGfPhJxNM8kh7DCXwUUi8+9T+pEqkGWDdxR3/v4+7pV5ma8WAeA24L5u1+mzcLBEW ANgPbi9MwyEI3OEZpctu3BswuC9JVUo+1u961uZ5ea8z50sfInasrdqzVqV7DPW648pq KZeF7gGX3JU7tec5p26Xgkt9eDf1Vy0FB/EbeogwBec2Og890kmcy2jWhcXqjskAK/Jo 7v5g== X-Forwarded-Encrypted: i=1; AJvYcCVT3rZg0/iheejwGm7IwzcU/BFtaGEXFRuCcq95le6UGwee6zwim1FuMfDmFksV3nmcDb/iXWDOkSbil+PCrzk2Z+iOj6HCHM+I6lUS X-Gm-Message-State: AOJu0YzBjlcZB+Ewo7BQBacIC2mqk0bbfUhU2fz6vbYMRJXMvGo+kSWV XkCKXTAviGJf35jZ0LCnWQFcAkFaoJNhH+kp1VUdJ5t72juVBQI2cDsGOHW0OCo= X-Received: by 2002:a17:907:110b:b0:a55:b592:7e0a with SMTP id qu11-20020a170907110b00b00a55b5927e0amr3486615ejb.48.1714826252559; Sat, 04 May 2024 05:37:32 -0700 (PDT) Received: from [192.168.1.20] ([178.197.223.16]) by smtp.gmail.com with ESMTPSA id ce3-20020a170906b24300b00a587831c09fsm2884330ejb.186.2024.05.04.05.37.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 May 2024 05:37:31 -0700 (PDT) Message-ID: <95f8d63a-0343-49c3-90b6-f91efe559841@linaro.org> Date: Sat, 4 May 2024 14:37:30 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/6] input: himax_hx83112b: add regulator handling To: Felix Kaechele , Job Noorman , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240504020745.68525-1-felix@kaechele.ca> <20240504020745.68525-3-felix@kaechele.ca> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex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GXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240504020745.68525-3-felix@kaechele.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/05/2024 04:04, Felix Kaechele wrote: > Handle regulators used on this chip family, namely AVDD and VDD. These > definitions are taken from the GPLv2 licensed vendor driver. > > Signed-off-by: Felix Kaechele > Link: https://github.com/HimaxSoftware/HX83112_Android_Driver > --- > drivers/input/touchscreen/himax_hx83112b.c | 48 ++++++++++++++++++++-- > 1 file changed, 44 insertions(+), 4 deletions(-) > > diff --git a/drivers/input/touchscreen/himax_hx83112b.c b/drivers/input/touchscreen/himax_hx83112b.c > index 4f6609dcdef3..0a797789e548 100644 > --- a/drivers/input/touchscreen/himax_hx83112b.c > +++ b/drivers/input/touchscreen/himax_hx83112b.c > @@ -19,10 +19,12 @@ > #include > #include > #include > +#include > > #define HIMAX_ID_83112B 0x83112b > > #define HIMAX_MAX_POINTS 10 > +#define HIMAX_MAX_SUPPLIES 2 > > #define HIMAX_REG_CFG_SET_ADDR 0x00 > #define HIMAX_REG_CFG_INIT_READ 0x0c > @@ -50,6 +52,7 @@ struct himax_event { > static_assert(sizeof(struct himax_event) == 56); > > struct himax_ts_data { > + struct regulator_bulk_data supplies[HIMAX_MAX_SUPPLIES]; > struct gpio_desc *gpiod_rst; > struct input_dev *input_dev; > struct i2c_client *client; > @@ -63,6 +66,11 @@ static const struct regmap_config himax_regmap_config = { > .val_format_endian = REGMAP_ENDIAN_LITTLE, > }; > > +static const char *const himax_supply_names[] = { > + "avdd", > + "vdd", > +}; > + That's confusing. Binding said only HX83100A family has regulators, but you request for everyone. > static int himax_read_config(struct himax_ts_data *ts, u32 address, u32 *dst) > { > int error; > @@ -267,7 +275,7 @@ static irqreturn_t himax_irq_handler(int irq, void *dev_id) > > static int himax_probe(struct i2c_client *client) > { > - int error; > + int error, i; > struct device *dev = &client->dev; > struct himax_ts_data *ts; > > @@ -290,11 +298,31 @@ static int himax_probe(struct i2c_client *client) > return error; > } > > + int num_supplies = ARRAY_SIZE(himax_supply_names); > + > + for (i = 0; i < num_supplies; i++) > + ts->supplies[i].supply = himax_supply_names[i]; > + > + error = devm_regulator_bulk_get(dev, devm_regulator_bulk_get_enable and drop rest of the code here. > + num_supplies, > + ts->supplies); Wrap it properly at 80, not one argument in one line. > + if (error) { > + dev_err(dev, "Failed to get supplies: %d\n", error); return dev_err_probe() > + return error; > + } > + > + error = regulator_bulk_enable(num_supplies, > + ts->supplies); > + if (error) { > + dev_err(dev, "Failed to enable supplies: %d\n", error); > + goto error_out; > + } > + Best regards, Krzysztof