Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp146373pxj; Thu, 3 Jun 2021 03:10:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXAG7hGBgP6PTpvgbhmN5ZDI+K/JkmKHzZKm7HpS8i1xqB1DNRdQS092K5mVWn9RZROuzF X-Received: by 2002:a17:906:15c2:: with SMTP id l2mr37955442ejd.348.1622715003905; Thu, 03 Jun 2021 03:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622715003; cv=none; d=google.com; s=arc-20160816; b=XJLeO1eQ4ffWsRkqWiv/V89ldgI3LwPR4Ubi7xaYpM328CMSIqsoxFeSkyhznXVkm/ 4SFiei3dPrgx4yp6Qr6MXCwCMUdvMYfpLCNSyNdnnN3QXaOt6EbwMEadzc/rKBPmHoDk 6PFIYZZtzW0qzBeaDxsrU9V7Kc2oOeK9iyPtPaqTPHFfqvEXoZQfaYlWwqkljz+VGLt8 KYoQDJ/YQ5Ay5lsH1W7P6e+G9wci7UwoVP093X+mRme1TLe8n/6o/9LsM36R2pe+7v8x ZZdlMrJCwc4Tluq7SLaghZf5rcRsR6G4w87smI9WmUqYQrp18HkNKtL3qE5nMZNyJLHx F3uw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QqNKLLnVKmpfmXU5JOxvCuHSUVBulaReraScJ4dYxAg=; b=HpIyxcQFveoiU/gFbeTPxyHupykO9GE0SWxJS/khmLU3nNPiLeOXzZ3UwyyKTuh74m xu/pu7mdR9woOcHpnwr5UBzX3xWiYBNxD3p24iVc6j8mFAbe3gOgWRImocDLXk5AgywS MjsQlLZNpSKTzictX8N+eKvZ8bGtGXpfLbIwt+lKON9ha9Qj4nXUeSJ+mGzlc/iY29Rc PkFTXHgPSNcIkJn/o47KHsapgrwCc9uSTELXY9/N6Vw5xUd+sUHdzd2kkyUU7e7sA7ra Vga0j1bPIbCLYuZwI66JnptFgLJAh8I+t1R+U0PqFjIjYNc4OdRTe9gV1F9ZMLDoa/ON QggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=bWZ5cBP6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m12si1964597ejc.581.2021.06.03.03.09.41; Thu, 03 Jun 2021 03:10:03 -0700 (PDT) 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=@mediatek.com header.s=dk header.b=bWZ5cBP6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbhFCKHf (ORCPT + 99 others); Thu, 3 Jun 2021 06:07:35 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:17970 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229765AbhFCKHb (ORCPT ); Thu, 3 Jun 2021 06:07:31 -0400 X-UUID: a154cdd1ca374cf7b8f68d81161cec1d-20210603 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=QqNKLLnVKmpfmXU5JOxvCuHSUVBulaReraScJ4dYxAg=; b=bWZ5cBP62iB5ga5nDrWGOHFdDKpekzFp/qA5yORgeV12phdq7ZxjmuBffkR/0H7P9ZC9cn0C8W5HsBRW+EuYF9pkYQ9iyk8w6do0TYpaVYTMlR4wd6hzNHqAV8uLmgeM0cPAtoDSF2cELJWgRWVrcdXiPaqXHBxwp8d7tYb3+Mc=; X-UUID: a154cdd1ca374cf7b8f68d81161cec1d-20210603 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 272275690; Thu, 03 Jun 2021 18:05:42 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Jun 2021 18:05:38 +0800 Received: from mszsdclx1018.gcn.mediatek.inc (10.16.6.18) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 3 Jun 2021 18:05:38 +0800 From: Jitao Shi To: Thierry Reding , Matthias Brugger CC: , , , , , , , , , , , , Jitao Shi Subject: [PATCH v4 3/3] pwm: mtk-disp: Switch to atomic API Date: Thu, 3 Jun 2021 18:05:31 +0800 Message-ID: <20210603100531.161901-4-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210603100531.161901-1-jitao.shi@mediatek.com> References: <20210603100531.161901-1-jitao.shi@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: BF5039ACF230207A3A171D0F20606B00DFDFFF836FCB485BEBAA3C56F56918192000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Q29udmVydCB0aGUgbGVnYWN5IGFwaSB0byBhdG9taWMgQVBJLg0KDQpTaWduZWQtb2ZmLWJ5OiBK aXRhbyBTaGkgPGppdGFvLnNoaUBtZWRpYXRlay5jb20+DQotL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