Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp622162rwl; Wed, 12 Apr 2023 01:28:36 -0700 (PDT) X-Google-Smtp-Source: AKy350b0Se+Xy1hBf/JkWRD0HhV+1uMYc4emomKTHiAoPyIkNDMdYvH8/tLdzPRoFuSbaOFQ0mL5 X-Received: by 2002:aa7:c2d2:0:b0:4fa:fcee:1727 with SMTP id m18-20020aa7c2d2000000b004fafcee1727mr13011547edp.13.1681288116411; Wed, 12 Apr 2023 01:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681288116; cv=none; d=google.com; s=arc-20160816; b=08HGFyLstPuhhIK0PBTcnbBqOBLGrq3VFoYVVeZO1HjMAKiKyeWKfd9kU3XaaoLPb3 MeIaLY2i1as2ZPzjQTQ+98XKgquxOkNJOipdrQNep52mi/8JEo3MuYoyFYDA2w1FdP7v 8WIlODWi1xskYgOt2DeCaLXjVq+RzuHeE6weSbi4lRA8gYDaHHgw4/2OojlzXiNmAr9s ZPDexmM/lohrjK6GVwilNAK19P59PAm6K/EH95z8R/YbmWL19SMH/lYvLp9dvuFTRRzu CPXGAxyEV+gaDMbRkL9gvVzkoR4BwdtbmT43E4jjROoYgHNVgI8wHwUFH0WQ01BZMjZ6 DU2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=yYhppzv6+XdqYhZKDAzADvPk5aGzU+ttAE3PCPhmPLQ=; b=07D8YJ4D+SqfJyq/QDazmW34yr27ai7p2SwT1PqVsLI3DU2MnzoYMIaTZntoknCouG fwb4g7044nRId5LMIU63YK2z2BB3wW5sgrniYptPTHdJDll6U39TpGC31k2ayIaL3R0C QHyolkQCXuHuqZ5qziSVqVf3aodPxI8gS4o0TFiwSKtj/eDvVH8J99T2CaqvlAvnKBE8 LSLkaAZG7LdyNhTbtyJ3pvqR6yp6fQ9Uf4Ws8TO92YqVXzSGd8A4a8JYo7GyWA6MDQa8 drI8ZfjGGh3Wd64oyJsZZ1uXoefq9j9y2kNcOVnEAti1P0NwlG11JsHNrKV0rjNx48wY uTYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020aa7c2d2000000b004fd18a8023asi2112710edp.495.2023.04.12.01.28.12; Wed, 12 Apr 2023 01:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229598AbjDLITd (ORCPT + 99 others); Wed, 12 Apr 2023 04:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjDLITd (ORCPT ); Wed, 12 Apr 2023 04:19:33 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00FA7C2; Wed, 12 Apr 2023 01:19:30 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 3BBD824E1BE; Wed, 12 Apr 2023 16:19:29 +0800 (CST) Received: from EXMBX162.cuchost.com (172.16.6.72) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 12 Apr 2023 16:19:29 +0800 Received: from [192.168.125.82] (113.72.145.176) by EXMBX162.cuchost.com (172.16.6.72) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 12 Apr 2023 16:19:28 +0800 Message-ID: <68839732-2d3f-aafc-8744-550f4bfa27f0@starfivetech.com> Date: Wed, 12 Apr 2023 16:19:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v1 6/7] soc: starfive: Add dphy pmu support Content-Language: en-US To: Conor Dooley CC: Rob Herring , Krzysztof Kozlowski , Emil Renner Berthing , Paul Walmsley , Palmer Dabbelt , Albert Ou , Walker Chen , , , References: <20230411064743.273388-1-changhuang.liang@starfivetech.com> <20230411064743.273388-7-changhuang.liang@starfivetech.com> <20230411-iron-everybody-70b78e94aee5@spud> From: Changhuang Liang In-Reply-To: <20230411-iron-everybody-70b78e94aee5@spud> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [113.72.145.176] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX162.cuchost.com (172.16.6.72) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/4/12 5:15, Conor Dooley wrote: > On Mon, Apr 10, 2023 at 11:47:42PM -0700, Changhuang Liang wrote: >> Add dphy pmu to turn on/off the dphy power switch. [...] >> + >> static int jh71xx_pmu_set_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool on) >> { >> struct jh71xx_pmu *pmu = pmd->pmu; >> @@ -191,6 +213,8 @@ static int jh71xx_pmu_set_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool on) >> >> if (pmu->match_data->pmu_type == JH71XX_PMU_GENERAL) >> ret = jh71xx_pmu_general_set_state(pmd, mask, on); >> + else if (pmu->match_data->pmu_type == JH71XX_PMU_DPHY) >> + ret = jh71xx_pmu_dphy_set_state(pmd, mask, on); > > Perhaps I am verging on over-complication, but I dislike this carry on. > Is this the only time we'll see a power domain provider coming out of > a syscon, or are there likely to be more? > Either way, I think having an ops struct w/ both parse_dt() and the > set_state() implementations would be neater than what you have here. > OK, I will use call back make here neater. > Very much open to dissenting opinions there though. Emil? Walker? > > Cheers, > Conor. > >> >> return ret; >> } [...] >> -- >> 2.25.1 >>