Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3509071pxu; Tue, 8 Dec 2020 14:06:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyOInlE5dq/n/Gtx9uOtoObHL38hHxpouk6Svl7iGrfgq5T4bmmBR6TCkaWVrjJvOAZiaB X-Received: by 2002:aa7:d915:: with SMTP id a21mr45306edr.251.1607465209832; Tue, 08 Dec 2020 14:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607465209; cv=none; d=google.com; s=arc-20160816; b=jcSdbarxRTJZ0lqibuAvv7EFkOdJix6WOdkSGD3yaDoy4kxafQNRnwJft6ZKa9Edfz +ZTGc3q0QIfD15IYLzXSggck5M5GDPLdlEO27xEaPlI0fWGs5r0nc52UZx9hZ9ac3vyb Z9o6KJfAq7BbVt7YrYRiB+93BKiNB5hNlBXx6Kb/gieW3rNIlnrfpoZnzH1NqyzTsCAt 3ePySQxR7l1vpDZQbh5Bu7hNcrkHPNsQ7jlCs4/aQjw3ZsmV4hbXjabo4EVtKNzS1/4h oKk4Y87K9KYs9wSjFOmQPslNbuT+JDO9dWMgn/qiZkMofqHYRFtSpvgnkXolMuKY5TK5 bJCQ== 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=0W8L1s/+E8M+O5m3NU5Cjqur7xln1/V/UMJdSR+R264=; b=vtlVHt7g7r04UShlDJwZUAdCOznEwKUQm+CXume8pWj9WsvLPY768v0Xcl4iPz10Wl taCtgsPE1MVY7L+fKoOQuSuzMgZfwifnUuImlMNCRKsyvBOvTIfa1UKWHiyK2Vl1SOUM MNszMpwSDBYNR9fchcwCqNvoqqgF1BbVx4SRx/l6yc624p1bBSDbzCOYfGBFAQWGFAYl 5L/jYIiU5GlamiI1FPBCF/P63V7q1V1rF/SQol4dlJjwodS8Os7/l6GbwU9O5rU23mDq /D2WXV1MeuwDnvlXcNEXnfNmXSB59t6m6XDKuuqOJZr0X23Bo4pERB+ZnjpWBzzocjaE c+Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=UVFUKXAK; 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 g20si5518504ejz.555.2020.12.08.14.06.26; Tue, 08 Dec 2020 14:06:49 -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=UVFUKXAK; 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 S1730652AbgLHWEW (ORCPT + 99 others); Tue, 8 Dec 2020 17:04:22 -0500 Received: from mout.gmx.net ([212.227.17.22]:36791 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730608AbgLHWEQ (ORCPT ); Tue, 8 Dec 2020 17:04:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607464945; bh=0W8L1s/+E8M+O5m3NU5Cjqur7xln1/V/UMJdSR+R264=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=UVFUKXAKROTOprum0Bxa8AAlMCbTb8S2jdMLfGiaG0tBNk91Oo0MyMlrfA9v7qdrX zMLoUlsnO4vp5NDEuQW64URRH61u/huMZO/0n36ILGq4CURhs0j7+PLa1rzi8KuRhF lYGhXeLdTjJQBH0KdSpj8HI3VZWeSgEf0zm5rbqM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([78.42.220.31]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N63VY-1k6i7M3dxg-016NUN; Tue, 08 Dec 2020 23:02:24 +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 v3] pwm: bcm2835: Support apply function for atomic configuration Date: Tue, 8 Dec 2020 23:01:45 +0100 Message-Id: <1607464905-16630-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:aKuR+reSMDTjWPkMggxhK4pXa7GsX+soPSBxaw2X6SiRgJ3gyEf eHuRyhr+2p1cY4DXylGklrqH2aM0gQTB+K5IkpcPy8olTJ8MnIdWfT1BIV/jvPBt9Kjvtep 8u+LRLFuHosJIDegsOBzZH/oiNvbpdmdzw9niv09U5u4Kzm7sjXf1DLoHJjsVWclPYaiVlI zov13P17h6H9/yvHgmFyg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:myZg7KeR1cw=:MRonv6eSgpTO/yMAIm6e4I d1W+NUCwofXYYR0/Sqnir9wtHFzgSa2PO/yvwVVOMklldh6o6df2Hmlj8AuX/ErxK8unb7yz6 sOh48kAXa27KfcHX0Z3rYzFVer0YIYO0QJJr5SRgfjHxREmn9uI46njGNbqoLBwW/QYcUfbez tNUky/SCZr6UqMUItZPiaT4kxSjmjTnGt+0Yz2xRBhU7HzXh6t/9TC52RsAiCEL5mriRuraau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