Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp2078964rdb; Sun, 21 Jan 2024 06:36:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEq3bTUHJSFH7SWej15NjDzfZCaRsZGySM300kiHKd9XNtgZ3s8ry48676GjOcIiEoUWPcI X-Received: by 2002:a62:5e06:0:b0:6d9:eb24:4c5f with SMTP id s6-20020a625e06000000b006d9eb244c5fmr953331pfb.37.1705847766747; Sun, 21 Jan 2024 06:36:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705847766; cv=pass; d=google.com; s=arc-20160816; b=XEdHDugfvruvvXmASIBVjr5rhm38o+GYeTZhV97K5p6Vdt4tSF7Wwnc3hEKI/U8vfp Ot1+DlB0yEYUtS+8l4ivIjUE8+zgpQtyIOPR1Vt07lbXeIUa1JEk5BQCIonNbyg5kj7l XSbgu6FB2B5f0CKXErmu5cGFlPBosXYENfEoHxUrkhw7Nn8Xg0tIj6Iqm7vI9b/9RKk1 zrmBxlNh6nk8RH3FxG39AoQtZNEDkKM/DxS9P2EJSEJAR2z58uh/skovMzh1aeunNCZD HMF+INT5q8/joLNCuvG2NFOgmlmnVOAJzWdN4QGggeJdrlxwRNYXha+YhAY/QPrxeFZo c8Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=872rfjy39rwVRPIkk3ndSS0WStZElYm0Qg/+47Tr7M4=; fh=Iki7gTkBFCAhvhI5v++sWvzR4dgry4vO2prcK2Gd+9I=; b=ioP4qju7ckko9YSlYlxgGZY/GZMqkcpzefanq7aBzwV/5j33GE8JKqKng3OrVv8tGs yDxzect7O16aY2xoTFPqvbUwTiNZ8x0YpbLsFHNcp+yYAxvYKjJJlQXyGItPSOx2xxzA KFsZVV8E9lvFHYvkW+xQS8GgnVB962SppTrvQwko6bn6cSNy3mOg25rAC6k8hg9zV6Kb DWi9Q8o6aH3tneibwLvr/c437CezMDJXNmyzQA/8dz7YWKabmbNlXlLQtZuVMwfBmRAR MQXN4a4wI3P/iMUSmM1b9KlIBXOrvbHwHsQspg0S2jbr3+uHR7U5SI3S6BfhaWldLop+ Wiig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tZXCaw6p; 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-32075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32075-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w188-20020a6262c5000000b006d9bc08f37bsi8653382pfb.116.2024.01.21.06.36.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 06:36:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32075-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=@linaro.org header.s=google header.b=tZXCaw6p; 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-32075-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32075-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FDA12822EA for ; Sun, 21 Jan 2024 14:36:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B76E5374EC; Sun, 21 Jan 2024 14:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tZXCaw6p" Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 61BF93716C for ; Sun, 21 Jan 2024 14:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705847759; cv=none; b=NczZZqaqvszx1kwV3vY2KV/4TU/7IQ9VupN02slUmcgosRgMcaqBDMA0QNLTK1tyA8QiFykGfutVTwCyKeizKngYMSyYJZIPrTlbbdkw61GcuzzYfMlC4cxc4eHUV3U7ycqrnZ52qvJRy9XyNWsljKXFRd2z2cJu9eMiyvOs3rI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705847759; c=relaxed/simple; bh=872rfjy39rwVRPIkk3ndSS0WStZElYm0Qg/+47Tr7M4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GMEwym58yo9rh0HVhqvcIHc5W/JKrIkEa3u9GhQakuYueGYR16jFhqflM4s8Gp/sbwpFJrgOzZjmuwiJ71iD1xxTB5kJxsrOioMrRtJ9IcEOvV6fSDCAMajRBsI5pUWjvPaJGdJRaUuhz9AWaZgEoIKo+M40dlkpW6o6wUYogx0= 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=tZXCaw6p; arc=none smtp.client-ip=209.85.128.174 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-yw1-f174.google.com with SMTP id 00721157ae682-5ffb07bdce2so8406257b3.2 for ; Sun, 21 Jan 2024 06:35:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705847757; x=1706452557; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=872rfjy39rwVRPIkk3ndSS0WStZElYm0Qg/+47Tr7M4=; b=tZXCaw6pMVa+X8oQTbA5GeBwbEEniZAqVwpANtGp2WRTt4H1BmEHGPW9h8XI8fVaj2 QPkS7gx7yqMPVzupWMlfUTaSFiHeOKZjh5aK9HzyB/LdcghER1Z0ibSnzC4x5JQAJipg Fg/DaoywD/98zdtutlIXAiBMcXYq65Hvzi8XE7/jZrm+hZM/Gdckl9czCxf8pOXZtjk4 RbF6bEksWScllJR8VcUVrohzLBdcZbJaVRxVUKXlLd9WVagSUE+IowLH4ye+eHolTfYT TlUd5HrcW/FUPirKZ2wljOI/LiFt1SQfLgh0ccFhZD9rFaPU7ftGM5xZugw27Qnpv0+5 faqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705847757; x=1706452557; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=872rfjy39rwVRPIkk3ndSS0WStZElYm0Qg/+47Tr7M4=; b=CduDFIbQ1xg0shIhbnriJLph2Fjo6tOmbT2uPTXVGOodIjaXCResRyd6rU2BvQksQo SKNIqre7J1NBFGZKXsQBbBBhHORvBBQw4eClD0AuD7t+o0vJbb0hQQdM9EwFmNh/85VL aJnWqiHZyMUkcV20MN1QAY5hBDYuYWrcD+ymzAuo5MAv3MSOlEpsowRY/epbSwb7czR1 ytJ0iuLGwxvlJMSx1Qw4XaCml+Cx8pAcvED7niNPKPqV6Ou7cYuBrftCqlJwLbgpOGtk V3Scfo3Fan8M8OLjicyLyMP2YFmMhTwWNzDtWB0eJfX+olNx5NJAoL46ocsXoM/IoB1x uNGQ== X-Gm-Message-State: AOJu0YxOqMOaaeWrAwWo5kmOfNooZyF/KrMdeXLJWsaomU7EepNNN1n6 54hAgfr8sBEYgpeuZXtuei138mrq7kFJqnPm6YYjoMauk/sAeTEbz7RcUVOuSv8mA3AQ1JvkrrA OULAarbveFTg519d+U8o9Bxy6/7Ep5KtiTU1PpA== X-Received: by 2002:a81:9c52:0:b0:5ff:96b8:f0b9 with SMTP id n18-20020a819c52000000b005ff96b8f0b9mr2720698ywa.90.1705847757431; Sun, 21 Jan 2024 06:35:57 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240120-ktd2801-v3-0-fe2cbafffb21@skole.hr> <20240120-ktd2801-v3-1-fe2cbafffb21@skole.hr> In-Reply-To: <20240120-ktd2801-v3-1-fe2cbafffb21@skole.hr> From: Linus Walleij Date: Sun, 21 Jan 2024 15:35:46 +0100 Message-ID: Subject: Re: [PATCH v3 1/3] leds: ktd2692: move ExpressWire code to library To: =?UTF-8?Q?Duje_Mihanovi=C4=87?= Cc: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Helge Deller , Karel Balej , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jan 20, 2024 at 10:27=E2=80=AFPM Duje Mihanovi=C4=87 wrote: > The ExpressWire protocol is shared between at least KTD2692 and KTD2801 > with slight differences such as timings and the former not having a > defined set of pulses for enabling the protocol (possibly because it > does not support PWM unlike KTD2801). Despite these differences the > ExpressWire handling code can be shared between the two, so move it into > a library in preparation for adding KTD2801 support. > > Suggested-by: Daniel Thompson > Signed-off-by: Duje Mihanovi=C4=87 This is great stuff. I looked at my KTD253 driver but AFAICT it uses a different method: instead of transferring a numeral, it increases/decreases a counter, so it can't use the library. > +extern void expresswire_power_off(struct expresswire_common_props *props= ); > +extern void expresswire_enable(struct expresswire_common_props *props); > +extern void expresswire_start(struct expresswire_common_props *props); > +extern void expresswire_end(struct expresswire_common_props *props); > +extern void expresswire_set_bit(struct expresswire_common_props *props, = bool bit); I would skip the keyword "extern" since it is default I think even checkpatch complains about it these days? Anyway, no big deal: Reviewed-by: Linus Walleij Yours, Linus Walleij