From patchwork Mon May 8 21:20:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 9716709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A08060365 for ; Mon, 8 May 2017 21:20:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36D8B252D5 for ; Mon, 8 May 2017 21:20:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B9FF269DA; Mon, 8 May 2017 21:20:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3B65252D5 for ; Mon, 8 May 2017 21:20:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 427B06E2B3; Mon, 8 May 2017 21:20:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CBC86E048; Mon, 8 May 2017 21:20:32 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id g12so10459747wrg.2; Mon, 08 May 2017 14:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DLEGvqBxi7IJ2YeEqCudraV3chgd0Hx43w2SYx+7Ico=; b=L+Pm7W4d8SkNZHUJHOwiFVIlxFQH+F0iwGxtUXofl8M2ShMRAq9tWcCQNIPkTDSWkW 7D6oCUikKLrOdHKVVNcQmxfQCrwdLYgKP9pBFa/FkjamQkwMSIjjSiRr62wtp5JtdqeB SV6390adHep1fwdka6avD7Scb0Ek3FiqAqO3N+0csDM5BAFKnbx6Mdkt9tfIWOuAAW7X JT4cUMTQmdVXZhxypw5H7um5UVEPEDcPAjPjfpipd1GZmOMppwIM/ZZKQVrxy207YqAO snCVRZ1EyZdPmzKvTK2e2f+BOoBVEtV/+AeQ9glz85DpgwUw4+DlHFJy+qJ5SybLWWrv IEkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DLEGvqBxi7IJ2YeEqCudraV3chgd0Hx43w2SYx+7Ico=; b=cY4/zM0cT9QLFIILHFa03I4P+lHnQS+XDRtr0pEFr2+rdDax0AtyMMg9VTr+J9CPPZ yFYXKHOra1hcjEMP7UAjH8JdYEavQhGunWrJE7ugx30Le4ias0IvQDtQ4xbAKYcw+WuS fsTVnAPDlfI8sY7gBXPAGfiUOspXIqIffAP43SAsBxW1frKTaYdeQRF6Oa0DRDzfjcP5 TKIxZ0jKdKGxahGzN+1aDD9VlCvxhWb/77CBSv7zuj+m8hlBfkkKwoddjh35UpXSGWSM ZAyBfTecmONAMnGfTUIQ+6Re3/YPC2YSWahbeoCTuNcStWHkUnKmRnNnr1x1B2SDNFRu XVhQ== X-Gm-Message-State: AN3rC/4OvtNMkYKq2l4/6O3eNV6KxF6EaCqEh+y97XT3uqrWGXRLq2e6 HyXGCsTOL5lRn+uv X-Received: by 10.223.161.221 with SMTP id v29mr33342969wrv.135.1494278430788; Mon, 08 May 2017 14:20:30 -0700 (PDT) Received: from localhost.localdomain (ip5f5adba3.dynamic.kabel-deutschland.de. [95.90.219.163]) by smtp.googlemail.com with ESMTPSA id v69sm4808199wmv.3.2017.05.08.14.20.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 May 2017 14:20:30 -0700 (PDT) From: Oscar Salvador To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH v6 1/5] nouveau/hwmon: Add config for all sensors and their settings Date: Mon, 8 May 2017 23:20:46 +0200 Message-Id: <1494278450-11021-2-git-send-email-osalvador.vilardaga@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1494278450-11021-1-git-send-email-osalvador.vilardaga@gmail.com> References: <1494278450-11021-1-git-send-email-osalvador.vilardaga@gmail.com> Cc: Oscar Salvador X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is a preparation for the next patches. It just adds the sensors with their possible configurable settings and then fills the struct hwmon_channel_info with all this information. Signed-off-by: Oscar Salvador Reviewed-by: Martin Peres --- drivers/gpu/drm/nouveau/nouveau_hwmon.c | 72 +++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c index 23b1670..24b40c5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c @@ -692,6 +692,78 @@ static const struct attribute_group hwmon_power_attrgroup = { static const struct attribute_group hwmon_power_caps_attrgroup = { .attrs = hwmon_power_caps_attributes, }; + +static const u32 nouveau_config_chip[] = { + HWMON_C_UPDATE_INTERVAL, + 0 +}; + +static const u32 nouveau_config_in[] = { + HWMON_I_INPUT | HWMON_I_MIN | HWMON_I_MAX | HWMON_I_LABEL, + 0 +}; + +static const u32 nouveau_config_temp[] = { + HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST | + HWMON_T_CRIT | HWMON_T_CRIT_HYST | HWMON_T_EMERGENCY | + HWMON_T_EMERGENCY_HYST, + 0 +}; + +static const u32 nouveau_config_fan[] = { + HWMON_F_INPUT, + 0 +}; + +static const u32 nouveau_config_pwm[] = { + HWMON_PWM_INPUT | HWMON_PWM_ENABLE, + 0 +}; + +static const u32 nouveau_config_power[] = { + HWMON_P_INPUT | HWMON_P_CAP_MAX | HWMON_P_CRIT, + 0 +}; + +static const struct hwmon_channel_info nouveau_chip = { + .type = hwmon_chip, + .config = nouveau_config_chip, +}; + +static const struct hwmon_channel_info nouveau_temp = { + .type = hwmon_temp, + .config = nouveau_config_temp, +}; + +static const struct hwmon_channel_info nouveau_fan = { + .type = hwmon_fan, + .config = nouveau_config_fan, +}; + +static const struct hwmon_channel_info nouveau_in = { + .type = hwmon_in, + .config = nouveau_config_in, +}; + +static const struct hwmon_channel_info nouveau_pwm = { + .type = hwmon_pwm, + .config = nouveau_config_pwm, +}; + +static const struct hwmon_channel_info nouveau_power = { + .type = hwmon_power, + .config = nouveau_config_power, +}; + +static const struct hwmon_channel_info *nouveau_info[] = { + &nouveau_chip, + &nouveau_temp, + &nouveau_fan, + &nouveau_in, + &nouveau_pwm, + &nouveau_power, + NULL +}; #endif int