Upgrade BDK

This commit is contained in:
suchmememanyskill
2023-07-22 18:37:52 +02:00
parent b0233b796e
commit 4505217b2c
73 changed files with 2223 additions and 2734 deletions

View File

@@ -1,7 +1,7 @@
/*
* Fan driver for Nintendo Switch
*
* Copyright (c) 2018-2020 CTCaer
* Copyright (c) 2018-2021 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -18,6 +18,7 @@
#include <thermal/fan.h>
#include <power/regulator_5v.h>
#include <soc/fuse.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/t210.h>
@@ -28,9 +29,20 @@ void set_fan_duty(u32 duty)
static bool fan_init = false;
static u16 curr_duty = -1;
if (duty > 236)
duty = 236;
if (curr_duty == duty)
return;
curr_duty = duty;
//! TODO: Add HOAG/AULA support.
u32 hw_type = fuse_read_hw_type();
if (hw_type != FUSE_NX_HW_TYPE_ICOSA &&
hw_type != FUSE_NX_HW_TYPE_IOWA)
return;
if (!fan_init)
{
// Fan tachometer.
@@ -46,9 +58,6 @@ void set_fan_duty(u32 duty)
fan_init = true;
}
if (duty > 236)
duty = 236;
// Inverted polarity.
u32 inv_duty = 236 - duty;
@@ -71,8 +80,6 @@ void set_fan_duty(u32 duty)
// Enable fan.
PINMUX_AUX(PINMUX_AUX_LCD_GPIO2) = 1; // Set source to PWM1.
}
curr_duty = duty;
}
void get_fan_speed(u32 *duty, u32 *rpm)