From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B453C433F5 for ; Wed, 25 May 2022 05:02:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB446112214; Wed, 25 May 2022 05:02:00 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2A35112214 for ; Wed, 25 May 2022 05:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653454918; x=1684990918; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=G+4q2xq4qvkX2bb/floL4LgpxHHEgChd71+7zpBhwvI=; b=OQkFNF4EnX+gUH5p+kQDLONPCc089AlKljx5JWwK96iFZvF+9CmW4bXF 2g4hpmxX7YbeIIDBN0PzAUt+7R5VRpchrU+DPfM7rtdsSwdy6k692mA6h VJybXP24UF8jtzmj7FDIR5xf7yeETVCj4ytjPp+uDWuxTMj2qFHQqz2Tn /BvVpS9phC5NqGwEFGwx29y96Vlo0sE8Y6iMpR+m4hUXrULEMTGDodLLC 2BxImp/fytA1dW8oXwkY63QASwaTwD4uuRFwfAToxsXIwKKqr74l/2mQj IQ1ckLwHUcGsHNdK/3u8XWd3xVS8MGIhbH7ygeQQJGKq/aanpUEEwpZB9 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="360108300" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="360108300" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 22:01:58 -0700 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="745522814" Received: from adixit-mobl1.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.88.118]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 22:01:57 -0700 Date: Tue, 24 May 2022 22:01:51 -0700 Message-ID: <87sfoytdc0.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Badal Nilawar In-Reply-To: <20220523110841.1151431-4-badal.nilawar@intel.com> References: <20220523110841.1151431-1-badal.nilawar@intel.com> <20220523110841.1151431-4-badal.nilawar@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915/hwmon: Add HWMON current voltage support X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, 23 May 2022 04:08:41 -0700, Badal Nilawar wrote: > > +static umode_t > +i915_in_is_visible(const struct i915_hwmon_drvdata *ddat, u32 attr) > +{ > + struct drm_i915_private *i915 = ddat->dd_uncore->i915; > + > + switch (attr) { > + case hwmon_in_input: > + return (IS_DG1(i915) || IS_DG2(i915)) ? 0444 : 0; Nit but maybe we should change this to: return i915_mmio_reg_valid() ? 0444 : 0; So that the platform checks are in one place in i915_hwmon_get_preregistration_info()?