cregit-Linux how code gets into the kernel

Release 4.7 drivers/staging/sm750fb/ddk750_power.c

#include "ddk750_help.h"
#include "ddk750_reg.h"
#include "ddk750_power.h"


void ddk750_setDPMS(DPMS_t state) { unsigned int value; if (getChipType() == 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 mukherjeesudip mukherjee5777.03%133.33%
mike rapoportmike rapoport1722.97%266.67%
Total74100.00%3100.00%


static unsigned int getPowerMode(void) { if (getChipType() == SM750LE) return 0; return PEEK32(POWER_MODE_CTRL) & POWER_MODE_CTRL_MODE_MASK; }

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee2177.78%125.00%
supriya karanthsupriya karanth311.11%125.00%
mike rapoportmike rapoport311.11%250.00%
Total27100.00%4100.00%

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

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee9079.65%133.33%
mike rapoportmike rapoport2320.35%266.67%
Total113100.00%3100.00%


void setCurrentGate(unsigned int gate) { unsigned int gate_reg; unsigned int mode; /* Get current power mode. */ mode = getPowerMode(); switch (mode) { case POWER_MODE_CTRL_MODE_MODE0: gate_reg = MODE0_GATE; break; case POWER_MODE_CTRL_MODE_MODE1: gate_reg = MODE1_GATE; break; default: gate_reg = MODE0_GATE; break; } POKE32(gate_reg, gate); }

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee58100.00%1100.00%
Total58100.00%1100.00%

/* * This function enable/disable the 2D engine. */
void enable2DEngine(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); setCurrentGate(gate); }

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee3269.57%133.33%
mike rapoportmike rapoport1328.26%133.33%
amitoj kaur chawlaamitoj kaur chawla12.17%133.33%
Total46100.00%3100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee3384.62%133.33%
mike rapoportmike rapoport512.82%133.33%
amitoj kaur chawlaamitoj kaur chawla12.56%133.33%
Total39100.00%3100.00%

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

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee3384.62%133.33%
mike rapoportmike rapoport512.82%133.33%
amitoj kaur chawlaamitoj kaur chawla12.56%133.33%
Total39100.00%3100.00%

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

Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee3384.62%133.33%
mike rapoportmike rapoport512.82%133.33%
amitoj kaur chawlaamitoj kaur chawla12.56%133.33%
Total39100.00%3100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
sudip mukherjeesudip mukherjee37082.59%111.11%
mike rapoportmike rapoport7115.85%666.67%
amitoj kaur chawlaamitoj kaur chawla40.89%111.11%
supriya karanthsupriya karanth30.67%111.11%
Total448100.00%9100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}