cregit-Linux how code gets into the kernel

Release 4.12 drivers/staging/sm750fb/ddk750_power.c

#include "ddk750_chip.h"
#include "ddk750_reg.h"
#include "ddk750_power.h"


void ddk750_set_dpms(DPMS_t state) { unsigned int value; if (sm750_get_chip_type() == SM750LE) { value = peek32(CRT_DISPLAY_CTRL) & ~CRT_DISPLAY_CTRL_DPMS_MASK; value |= (state << CRT_DISPLAY_CTRL_DPMS_SHIFT); poke32(CRT_DISPLAY_CTRL, value); } else { value = peek32(SYSTEM_CTRL); value = (value & ~SYSTEM_CTRL_DPMS_MASK) | state; poke32(SYSTEM_CTRL, value); } }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee5168.92%116.67%
Mike Rapoport1722.97%233.33%
Matthieu Simon45.41%116.67%
Moshe Green11.35%116.67%
Elise Lennion11.35%116.67%
Total74100.00%6100.00%


static unsigned int get_power_mode(void) { if (sm750_get_chip_type() == SM750LE) return 0; return peek32(POWER_MODE_CTRL) & POWER_MODE_CTRL_MODE_MASK; }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee1866.67%114.29%
Mike Rapoport311.11%228.57%
Supriya Karanth311.11%114.29%
Elise Lennion13.70%114.29%
Matthieu Simon13.70%114.29%
Moshe Green13.70%114.29%
Total27100.00%7100.00%

/* * SM50x can operate in one of three modes: 0, 1 or Sleep. * On hardware reset, power mode 0 is default. */
void sm750_set_power_mode(unsigned int mode) { unsigned int ctrl = 0; ctrl = peek32(POWER_MODE_CTRL) & ~POWER_MODE_CTRL_MODE_MASK; if (sm750_get_chip_type() == SM750LE) return; switch (mode) { case POWER_MODE_CTRL_MODE_MODE0: ctrl |= POWER_MODE_CTRL_MODE_MODE0; break; case POWER_MODE_CTRL_MODE_MODE1: ctrl |= POWER_MODE_CTRL_MODE_MODE1; break; case POWER_MODE_CTRL_MODE_SLEEP: ctrl |= POWER_MODE_CTRL_MODE_SLEEP; break; default: break; } /* Set up other fields in Power Control Register */ if (mode == POWER_MODE_CTRL_MODE_SLEEP) { ctrl &= ~POWER_MODE_CTRL_OSC_INPUT; #ifdef VALIDATION_CHIP ctrl &= ~POWER_MODE_CTRL_336CLK; #endif } else { ctrl |= POWER_MODE_CTRL_OSC_INPUT; #ifdef VALIDATION_CHIP ctrl |= POWER_MODE_CTRL_336CLK; #endif } /* Program new power mode. */ poke32(POWER_MODE_CTRL, ctrl); }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee7364.60%114.29%
Mike Rapoport2320.35%228.57%
Elise Lennion1311.50%114.29%
Matthieu Simon21.77%114.29%
Moshe Green10.88%114.29%
Arnd Bergmann10.88%114.29%
Total113100.00%7100.00%


void sm750_set_current_gate(unsigned int gate) { if (get_power_mode() == POWER_MODE_CTRL_MODE_MODE1) poke32(MODE1_GATE, gate); else poke32(MODE0_GATE, gate); }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee1754.84%120.00%
Elise Lennion1135.48%240.00%
Matthieu Simon26.45%120.00%
Arnd Bergmann13.23%120.00%
Total31100.00%5100.00%

/* * This function enable/disable the 2D engine. */
void sm750_enable_2d_engine(unsigned int enable) { u32 gate; gate = peek32(CURRENT_GATE); if (enable) gate |= (CURRENT_GATE_DE | CURRENT_GATE_CSC); else gate &= ~(CURRENT_GATE_DE | CURRENT_GATE_CSC); sm750_set_current_gate(gate); }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee2963.04%120.00%
Mike Rapoport1328.26%120.00%
Arnd Bergmann24.35%120.00%
Amitoj Kaur Chawla12.17%120.00%
Matthieu Simon12.17%120.00%
Total46100.00%5100.00%


void sm750_enable_dma(unsigned int enable) { u32 gate; /* Enable DMA Gate */ gate = peek32(CURRENT_GATE); if (enable) gate |= CURRENT_GATE_DMA; else gate &= ~CURRENT_GATE_DMA; sm750_set_current_gate(gate); }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee3076.92%120.00%
Mike Rapoport512.82%120.00%
Arnd Bergmann25.13%120.00%
Amitoj Kaur Chawla12.56%120.00%
Matthieu Simon12.56%120.00%
Total39100.00%5100.00%

/* * This function enable/disable the GPIO Engine */
void sm750_enable_gpio(unsigned int enable) { u32 gate; /* Enable GPIO Gate */ gate = peek32(CURRENT_GATE); if (enable) gate |= CURRENT_GATE_GPIO; else gate &= ~CURRENT_GATE_GPIO; sm750_set_current_gate(gate); }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee3076.92%120.00%
Mike Rapoport512.82%120.00%
Arnd Bergmann25.13%120.00%
Matthieu Simon12.56%120.00%
Amitoj Kaur Chawla12.56%120.00%
Total39100.00%5100.00%

/* * This function enable/disable the I2C Engine */
void sm750_enable_i2c(unsigned int enable) { u32 gate; /* Enable I2C Gate */ gate = peek32(CURRENT_GATE); if (enable) gate |= CURRENT_GATE_I2C; else gate &= ~CURRENT_GATE_I2C; sm750_set_current_gate(gate); }

Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee3076.92%120.00%
Mike Rapoport512.82%120.00%
Arnd Bergmann25.13%120.00%
Matthieu Simon12.56%120.00%
Amitoj Kaur Chawla12.56%120.00%
Total39100.00%5100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Sudip Mukherjee29068.88%16.25%
Mike Rapoport7116.86%637.50%
Elise Lennion276.41%425.00%
Matthieu Simon133.09%16.25%
Arnd Bergmann102.38%16.25%
Amitoj Kaur Chawla40.95%16.25%
Supriya Karanth30.71%16.25%
Moshe Green30.71%16.25%
Total421100.00%16100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.