From patchwork Mon Aug 26 08:33:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 822805 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011055.outbound.protection.outlook.com [52.101.70.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F69313C9A2; Mon, 26 Aug 2024 08:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724661210; cv=fail; b=TLZ7YFNBXO3ngYgG5Ls9CDYH/l16k4983fUkZDQE1Xk77+pN4yODO+OJDp056LKpxuinwxUNFk3j/KAhGD6tPoA2WcMMz9DDi7Up4GDIvbj7aOqzmsnHrm2igQd9dnoAg11dE6n8645ayzX3cNKcQ8+839kCKBnbiqah1qT1ZCU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724661210; c=relaxed/simple; bh=HPlWVsJzXFZXal9Qxvnl+seP+Of+CWjyuE/94RHu798=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=kNdbNi5csDMY1NOwTOsC95KqdjCkLhyp0VAhxe62ASh6ld0Znns/hbg9Vv8lnjtmQhmKMXNCjalTAXngDCcDD0YjE2FB6sAPdx+89zGD1Rpb2M3M5MhvLgAvhw2RvMyjTayBpaJGWxDJJ/7Ny5R5Q2L2AkCeXSgmOs4cZb3qE7s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=UjtAv2iT; arc=fail smtp.client-ip=52.101.70.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="UjtAv2iT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eQKTGqBLBtvFFVTgTkE3awHx47Ng6CxtWpLAtE66Ttl9vOpCTQX9N4OCUDelV4OLr3kXmHOnY4KHsfjEa5WY+tzeU41U3zTSy5l2zgfOQlX2SGzUx38/WNnKChds3EiMOnXvsZnMs3ko949pUXb3495Loeysvi0NJmuWpK1m7becIiMNH7XFDiBqdfJXKOmEwq4I8xidgx55+dBfujUfnfez9dkwbXnjISFBJUteLz5GswC+jxjMKNZfTmeqluAITu/fKlswMKdQJUaUKcQ32S/aXgxIWPgSMtcrjG6tJAHyf0xHL1EEm8amonlUO56GPrdhOG9G8NcOtMWQ612yWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DS0ZLvGm1DuC3MG9+fg3xjws1HrMG8Cr+MaVXDfozPo=; b=gqKsPDbFzVZqOeFyeb4jojUY/6PKBJWGvrS46U1ZyaPWvCkU6s4kKo0rtp6JNQ/YtnerfVbM6dC8y22fUPZw/bya2L/rveHWETNfQ/8UzZIpNLdzLtnotWHi36PDmGuVYfXOGjgdCNQbJ70dDyUTli+ThPX/tNeuVKsCePEtgHyXaM+Na0utHsKKhN0DuTAqiTmuhcJ6ejfZjL6x48BK/MXs0J1+kXuiQgXVRT3USRrKM4CW2XjPkDXGmDnE+gwhUEkDrTBo2dzd9zKfk+IppUBvqQqbLX9X+fTJ3wPYnfWPkNi9yEFYvMko9OzRxUA68sbZKmcjb2lh2w83nU1Kww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DS0ZLvGm1DuC3MG9+fg3xjws1HrMG8Cr+MaVXDfozPo=; b=UjtAv2iT3xJ5SfxN+x05/tLgC5dUvfg9hPK0B/ddUollK5VwZktMpWyzUMod5pO9LaVdHxmsRgUz1ed00MxyGiJQ8dpITPlA25KYLLS4LLRlBRzeamrzYOwCMTrSFmxqZ94xwJ4lbL0sSPSJSLB91YaIeWQy6RIiuk9qBf1K9wHcTBdbNRTdcngJpMf5NbKISv7L/94wxi063qVLDUMi4gY7vCT0KMFloPDSULhrkry+q5ekU8tJ5hvuoJxaS8hDcAxTPRfs8IYvbo8Wsa2CsRHrca4LB9AcHQwVdaZk6sMOTyo0RUEWJtZxjZaIrboRh1rkgyb8TifISU4MLDeS1w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by VI2PR04MB10931.eurprd04.prod.outlook.com (2603:10a6:800:271::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug 2024 08:33:25 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%2]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024 08:33:25 +0000 From: Liu Ying To: linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, ukleinek@kernel.org, xiaoning.wang@nxp.com, Frank.Li@nxp.com, lee@kernel.org Subject: [PATCH] pwm: adp5585: Set OSC_EN bit to 1 when PWM state is enabled Date: Mon, 26 Aug 2024 16:33:37 +0800 Message-Id: <20240826083337.1835405-1-victor.liu@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR02CA0064.apcprd02.prod.outlook.com (2603:1096:4:54::28) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|VI2PR04MB10931:EE_ X-MS-Office365-Filtering-Correlation-Id: fe5984fb-e086-4f9b-3ca5-08dcc5a9c07a X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: Mg7VtQl6S3FGOXU6v72Nu/x21BLS0s3ZG5ZH4m9YPU/d4KIW/CQH7sNsmh8DdM7Ykhpo0SBt+UWRqRqUSlCmWeuH7WWO7jqSbaaz/0Ph4qXrZd8usKVjjYOIts1tQQbGiUt64AabLfUlmEnm/UTR73EM3Rd1SzBVSSWVptxlfgomzavalYrGuouRXOraJjIie4eX7eBffdrfCSo/uBGHlWNyDkL9O9FF4x5UJxGm09pTQGg/UJIkvKqFoDGaCJyNjKQwL55fzbz6/MXKbLOygOBwC9JmV9WkpnwlTk+yyu0vHI5IrWDwCh80wlZn0FXLaQEfC64tRv4nj33IKHU96v8+kXITlCYkjUifN3c1mjb3b/U8rJQn978Iq3vG/QMlxtUonCjw0evwdGQsB5tF4M4Xd7eWErik+m8fq7QFQXIAPsazDu72+QleppF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od.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lU7hJLSX8Kj1Y6fCrZAiUa4oMRILY+aCO6otpJLuvG07Bs6JEncReQSYr1mN0qqY2lKMnXnMCSC6VeN7N79hHvkuO5zfEcTATrM8nq3x3cDd6V5XKsGf/Zq7Gi1f+sbr4E2ZabzaKhIJEJzdUS3friLNxYZM16BZHHNGFTnFewh2+0oG5RfbswKFjMgqLzt+urFMPHpb2ddiztLbjrMvRBLGlYuRSZiZy4g+85AIF/poC8XVTuozz9RN8Nj2GDRW+m0/O8GjHZTrnyjCd3NXE/lhKefH4tixgGnX0wtL0SsoWjmCjSLh7S61PiOoQlU8177fImzOAj3Mj4jfda2XJcNRNOqYFzyEzxVAs8pG1gLdrB2PyfYq57F+UbbK7r0vNxzoLcaptvw3twf3dgWWfUvz5Tnhjf8qteyQrgM5Vz3OlLLPsEDOTYAXVfP11lf5emK6tVF7MDZ8jOUx6JMKQ1Z3leXftEx4iZFCbyBMnaUgD0hohF8wYjyqNe1stuYNkpVY7AFLjb1rC7Ou0nV+vUAegAJLnhsQHJ/gAFQ/l9K+rJQXrx9Bg5Q/b637KRQg1YAiEZo6jS0G9SduacNh2RJDDaIeU7EeXqdTU7XU4UuLFEUKmgEHAEO4Bajf+8oCJfvI8UJz0y4sddqEexqtvQu81dl9L8ck8YOponPJsABoRQoj5eB/kAfO8ia3njHtoBJHo97KPnabhEM8TjwskFI4W4bzlnFqJ4KYBg+4/ZlnbE/QIOLAFfAs1GzOy1q6s2XYxJKLZOp16qxEZlyrt+JaxjG4LXNfxwCc3YD3O3EzBlY9wSapafdv2jjyy1YyikV6jlFpgda6TXMZkYRrSq4xk2EzDxj4h2D1bvw6nrEMwsCvstkehFgZ3rBBNo/6XZcJQzxYRaLYkocnsGBXBbZ2/C8G1Aju5LExZzP4oubNHYG+UzrsAnkjseF0ZgtH2gt7LqzZm+ZPsQV5JBTpcAN3U3WbAfcZ83RgFbQ6AP0btKeBrQZaqrbWhj5A3CmJm8XRE+S5hIp31SnDvb5ugJT5+cwpl3Svyqqc0cdlQXJOT5ieaCLSdP1zt6jDZ46nqLHxPuvCfOE/55jBKbB0mR9SxMkKygOwz3xK8EFf1kGAhvNTmlTe1IUCOZ5V2pP2iSSd7mMrT5Gc/le/6gnSPWcEUEt8uW0hPi5sXN9/N7Wgv1LZPlzKdBRpaik48RxrLZqxxpwmC00ykK09N3GledQMIuoa7AozM6MNAGv4zkUSA+zgi69ibQVcF23nVgQ+k27+hIHJQXAYjYsCw2Z127ggXWMgUsUGfjlC26Je/Gb4mDhWbS1Ue2bSujA74UyeOST/QwTzcyQ4E8kMSe2AJtlyTbEdDi8fnlU9C9f4/KKYb1GMFyvsK47uBVsBk0YuObo3SCa7G2OCZf812oIPjZQYnLBwHACiVL38+OqYPWLISu3dH1cG24pO/yvL7QmMr/5xcWIgl20LopjWSfU31U9Si9YrJdgRileJTOak0CVl3Ct05De24cxOVET6E7U5eyZUV0mg7TaXZ34qVaIi/wDM1vjHMgV03wycknFhIjkQi/JyUsrd4QCD0wv7FPh0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe5984fb-e086-4f9b-3ca5-08dcc5a9c07a X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:33:25.2661 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KRTkyIO9J961Dxz7rOwlwDVKYbwSbfFcZi16NQX2CjogU0v2Hb+sB9dRONqJauNEAfJLJSOmmQF8HswREjlLFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10931 It turns out that OSC_EN bit in GERNERAL_CFG register has to be set to 1 when PWM state is enabled, otherwise PWM signal won't be generated. Fixes: e9b503879fd2 ("pwm: adp5585: Add Analog Devices ADP5585 support") Signed-off-by: Liu Ying --- drivers/pwm/pwm-adp5585.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pwm/pwm-adp5585.c b/drivers/pwm/pwm-adp5585.c index ed7e8c6bcf32..40472ac5db64 100644 --- a/drivers/pwm/pwm-adp5585.c +++ b/drivers/pwm/pwm-adp5585.c @@ -100,6 +100,10 @@ static int pwm_adp5585_apply(struct pwm_chip *chip, if (ret) return ret; + ret = regmap_set_bits(regmap, ADP5585_GENERAL_CFG, ADP5585_OSC_EN); + if (ret) + return ret; + return regmap_set_bits(regmap, ADP5585_PWM_CFG, ADP5585_PWM_EN); }