Skip to content

Commit

Permalink
Merge tag 'soc-arm-6.14' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/soc/soc

Pull SoC arm platform code updates from Arnd Bergmann:
 "The updates here add code for the Microchip SAMA7D65 SoC, as well as
  minor bugfixes for OMAP"

* tag 'soc-arm-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  ARM: omap1: Fix up the Retu IRQ on Nokia 770
  ARM: omap2plus_defconfig: enable charger of TWL603X
  ARM: at91: add new SoC sama7d65
  ARM: at91: pm: change BU Power Switch to automatic mode
  soc: atmel: fix device_node release in atmel_soc_device_init()
  ARM: OMAP2+: Fix a typo
  • Loading branch information
Linus Torvalds committed Jan 24, 2025
2 parents 0afd220 + 2fd7a3f commit 1e8f6db
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
1 change: 1 addition & 0 deletions arch/arm/configs/omap2plus_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ CONFIG_POWER_RESET_GPIO=y
CONFIG_BATTERY_BQ27XXX=m
CONFIG_CHARGER_ISP1704=m
CONFIG_CHARGER_TWL4030=m
CONFIG_CHARGER_TWL6030=m
CONFIG_CHARGER_BQ2415X=m
CONFIG_CHARGER_BQ24190=m
CONFIG_CHARGER_BQ24735=m
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/mach-at91/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ config SOC_SAMA5D4
help
Select this if you are using one of Microchip's SAMA5D4 family SoC.

config SOC_SAMA7D65
bool "SAMA7D65 family"
depends on ARCH_MULTI_V7
select HAVE_AT91_GENERATED_CLK
select HAVE_AT91_SAM9X60_PLL
select HAVE_AT91_USB_CLK
select HAVE_AT91_UTMI
select SOC_SAMA7
help
Select this if you are using one of Microchip's SAMA7D65 family SoC.

config SOC_SAMA7G5
bool "SAMA7G5 family"
depends on ARCH_MULTI_V7
Expand Down
31 changes: 20 additions & 11 deletions arch/arm/mach-at91/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,21 @@ static int at91_suspend_finish(unsigned long val)
return 0;
}

static void at91_pm_switch_ba_to_vbat(void)
/**
* at91_pm_switch_ba_to_auto() - Configure Backup Unit Power Switch
* to automatic/hardware mode.
*
* The Backup Unit Power Switch can be managed either by software or hardware.
* Enabling hardware mode allows the automatic transition of power between
* VDDANA (or VDDIN33) and VDDBU (or VBAT, respectively), based on the
* availability of these power sources.
*
* If the Backup Unit Power Switch is already in automatic mode, no action is
* required. If it is in software-controlled mode, it is switched to automatic
* mode to enhance safety and eliminate the need for toggling between power
* sources.
*/
static void at91_pm_switch_ba_to_auto(void)
{
unsigned int offset = offsetof(struct at91_pm_sfrbu_regs, pswbu);
unsigned int val;
Expand All @@ -609,24 +623,19 @@ static void at91_pm_switch_ba_to_vbat(void)

val = readl(soc_pm.data.sfrbu + offset);

/* Already on VBAT. */
if (!(val & soc_pm.sfrbu_regs.pswbu.state))
/* Already on auto/hardware. */
if (!(val & soc_pm.sfrbu_regs.pswbu.ctrl))
return;

val &= ~soc_pm.sfrbu_regs.pswbu.softsw;
val |= soc_pm.sfrbu_regs.pswbu.key | soc_pm.sfrbu_regs.pswbu.ctrl;
val &= ~soc_pm.sfrbu_regs.pswbu.ctrl;
val |= soc_pm.sfrbu_regs.pswbu.key;
writel(val, soc_pm.data.sfrbu + offset);

/* Wait for update. */
val = readl(soc_pm.data.sfrbu + offset);
while (val & soc_pm.sfrbu_regs.pswbu.state)
val = readl(soc_pm.data.sfrbu + offset);
}

static void at91_pm_suspend(suspend_state_t state)
{
if (soc_pm.data.mode == AT91_PM_BACKUP) {
at91_pm_switch_ba_to_vbat();
at91_pm_switch_ba_to_auto();

cpu_suspend(0, at91_suspend_finish);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/board-nokia770.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static struct gpiod_lookup_table nokia770_irq_gpio_table = {
GPIO_LOOKUP("gpio-0-15", 15, "ads7846_irq",
GPIO_ACTIVE_HIGH),
/* GPIO used for retu IRQ */
GPIO_LOOKUP("gpio-48-63", 15, "retu_irq",
GPIO_LOOKUP("gpio-48-63", 14, "retu_irq",
GPIO_ACTIVE_HIGH),
/* GPIO used for tahvo IRQ */
GPIO_LOOKUP("gpio-32-47", 8, "tahvo_irq",
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/powerdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm)
* Set the powerdomain @pwrdm's next power state to @pwrst. The powerdomain
* may not enter this state immediately if the preconditions for this state
* have not been satisfied. Returns -EINVAL if the powerdomain pointer is
* null or if the power state is invalid for the powerdomin, or returns 0
* null or if the power state is invalid for the powerdomain, or returns 0
* upon success.
*/
int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
Expand Down
2 changes: 1 addition & 1 deletion drivers/soc/atmel/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ static const struct of_device_id at91_soc_allowed_list[] __initconst = {

static int __init atmel_soc_device_init(void)
{
struct device_node *np = of_find_node_by_path("/");
struct device_node *np __free(device_node) = of_find_node_by_path("/");

if (!of_match_node(at91_soc_allowed_list, np))
return 0;
Expand Down

0 comments on commit 1e8f6db

Please sign in to comment.