Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4281473pxu; Wed, 9 Dec 2020 13:00:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxc/H07lhMntQYHE9yU0hWQpZNGjQoSo1VtGL00eD5cv/nTdLpgbM6S95AwB8+XS+JceKKm X-Received: by 2002:a17:906:a011:: with SMTP id p17mr3632522ejy.30.1607547630533; Wed, 09 Dec 2020 13:00:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607547630; cv=none; d=google.com; s=arc-20160816; b=zv3etVR1ave/O3Wc19l4TztK7B8VGaVHlZ76bBSkPtZD9HNp4j1MDkVqiC5ZisvxQK gFl9wMe4qkS2P8wYx2VDAC+lcHdiD+m4kRTbW9JnV9olUOxUzp26jlPNkjSI14wZl9kP 224xQ3NNfl/XxutZUewNkYxREGp3ClPhUOcZfMvGfgTjMrhuqIovbRwl+th+xBueIFMr bNaOFtKfugikj1J5UVYUieBQM/yroDnbKh8VRIrUZw6zX5vyDuMJyYfupDB3ofsqJHpQ 2xV/n83Dy4jjSiwVmk4HiKoVIe4p4daLKPKWHk82436OXotd1Y63yfTQfbBMunOi/FRL C4rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cZK9lXe+lnP5mffhlgig8QrTV7IO6552Uuy5B8WoglA=; b=05f2McqDtglQfRzr3AiFF+zYyqvCFPhbn+oaQ2NAAed3kPiIT/XxfjRtrIz26pbWGr R1ioKQJFa6mdpulahA8XomhQWUHeRLzOHnIcSYmBy3lQWnkC98t/4X9QqXEoxCLYgUSe Z9ZLf8ESUvKJeuMTnmEtgnQHvdm2ajR9p+nHN3/g/HgOKNMoaYgXRQ4ULY7PwkccCImP doxGKC5SGl8+acqNhBw6ihKJ9ccJ8UWxmrXBAt7ur/4D4vMFq+mogjuN8mcC16Y6H0r6 hAzFj21sHBIoX8aZPmFXfFT4R9f0Okau07ntbD6XYHFGCnSLdeYi+Hy9msP8BBQXbs/V 3KtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=DtsuGwCn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x13si1299654ejb.243.2020.12.09.13.00.05; Wed, 09 Dec 2020 13:00:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=DtsuGwCn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732979AbgLIUup (ORCPT + 99 others); Wed, 9 Dec 2020 15:50:45 -0500 Received: from mout.gmx.net ([212.227.15.15]:60915 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732812AbgLIUuo (ORCPT ); Wed, 9 Dec 2020 15:50:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607546940; bh=cZK9lXe+lnP5mffhlgig8QrTV7IO6552Uuy5B8WoglA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=DtsuGwCnXW+TGgzpJs9Hmkmi91Js//KOffuNTb6ilk2CjFYZ4mjzAgiTzVnO2SP5l 9dyd8kUfeTjF5qr53mMPRb3hBOa65krsEuPOy5kV8VPjrtZuB+25pt7xlk84zGxmZW OQBPEsIOLGaDgzSTpb248isrf0EbrLcmIaTFCaPc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([78.42.220.31]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MZktZ-1kbIpI3RLD-00WqNi; Wed, 09 Dec 2020 21:48:59 +0100 From: Lino Sanfilippo To: thierry.reding@gmail.com Cc: u.kleine-koenig@pengutronix.de, lee.jones@linaro.org, nsaenzjulienne@suse.de, f.fainelli@gmail.com, rjui@broadcom.com, sean@mess.org, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux-pwm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lino Sanfilippo Subject: [PATCH v4] pwm: bcm2835: Support apply function for atomic configuration Date: Wed, 9 Dec 2020 21:48:25 +0100 Message-Id: <1607546905-20549-1-git-send-email-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:Jv47Zx8hJDQO6NMVX5/d9WEbTrKJ8taFw5fjTtl2u6kKHkEV1aG +no7QZOePQ3HfIvSvBco9NIs4V9CsEliAJ6eUxtnV4IHcI/7izOqxILns33APkl835Fi+R4 BLmleqNWmAoc596/3YvWonROoK9V7+ibWgkPkRLyAawgxNo6QfgTuX8RRBm0R9Wh1H2ou9P Kp7ql3cGJ6CC6rF5nPqSw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:hm6ziXOeYcc=:sppEYLbECBwTAJKPqBS/sL 8WZMMd9JMQPE08AduLKgl++IFUwCYidEKVX0ZApGDQCrzq4CEvgWkM028oIu+49ktGXVwwQGw y7IKuILyGym65vXnwnpnqyHfi7Gk9xavEAiw2BNrXvV4iDzdTtp5dE6+nZdjet6BAQHCZ3fsd mcCXwlPhXMg+yDQ4xEoQYyM17XEO38uJAo0H7d5VS8A5eiNo4yE3y+ip3nL9epCZ/1qisyeKa BT8plJ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