| /OK3568_Linux_fs/kernel/drivers/clk/qcom/ |
| H A D | clk-spmi-pmic-div.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 #include <linux/clk-provider.h> 24 struct clkdiv { struct 33 static inline struct clkdiv *to_clkdiv(struct clk_hw *hw) in to_clkdiv() argument 35 return container_of(hw, struct clkdiv, hw); in to_clkdiv() 43 return 1 << (div_factor - 1); in div_factor_to_div() 51 static bool is_spmi_pmic_clkdiv_enabled(struct clkdiv *clkdiv) in is_spmi_pmic_clkdiv_enabled() argument 55 regmap_read(clkdiv->regmap, clkdiv->base + REG_EN_CTL, &val); in is_spmi_pmic_clkdiv_enabled() 61 __spmi_pmic_clkdiv_set_enable_state(struct clkdiv *clkdiv, bool enable, in __spmi_pmic_clkdiv_set_enable_state() argument 65 unsigned int ns = clkdiv->cxo_period_ns; in __spmi_pmic_clkdiv_set_enable_state() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/media/rc/ |
| H A D | tango-ir.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 13 #include <media/rc-core.h> 15 #define DRIVER_NAME "tango-ir" 60 v = readl_relaxed(ir->rc5_base + IR_NEC_DATA); in tango_ir_handle_nec() 62 rc_repeat(ir->rc); in tango_ir_handle_nec() 67 rc_keydown(ir->rc, proto, code, 0); in tango_ir_handle_nec() 74 data = readl_relaxed(ir->rc5_base + IR_RC5_DATA); in tango_ir_handle_rc5() 84 rc_keydown(ir->rc, RC_PROTO_RC5, code, toggle); in tango_ir_handle_rc5() 91 data0 = readl_relaxed(ir->rc6_base + RC6_DATA0); in tango_ir_handle_rc6() 92 data1 = readl_relaxed(ir->rc6_base + RC6_DATA1); in tango_ir_handle_rc6() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/cpufreq/ |
| H A D | s3c2412-cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 #include <linux/soc/samsung/s3c-cpufreq-core.h> 23 #include <linux/soc/samsung/s3c-pm.h> 55 fclk = cfg->freq.fclk; in s3c2412_cpufreq_calcdivs() 56 armclk = cfg->freq.armclk; in s3c2412_cpufreq_calcdivs() 57 hclk_max = cfg->max.hclk; in s3c2412_cpufreq_calcdivs() 68 __func__, cfg->freq.fclk, cfg->freq.armclk, in s3c2412_cpufreq_calcdivs() 69 cfg->freq.hclk, cfg->freq.pclk); in s3c2412_cpufreq_calcdivs() 78 cfg->divs.arm_divisor = armdiv; in s3c2412_cpufreq_calcdivs() 85 cfg->freq.hclk = hclk = armdiv_clk / hdiv; in s3c2412_cpufreq_calcdivs() [all …]
|
| H A D | s3c2440-cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2006-2009 Simtec Electronics 23 #include <linux/soc/samsung/s3c-cpufreq-core.h> 24 #include <linux/soc/samsung/s3c-pm.h> 54 long diff = a - b; in within_khz() 56 return (diff >= -1000 && diff <= 1000); in within_khz() 60 * s3c2440_cpufreq_calcdivs - calculate divider settings 73 fclk = cfg->freq.fclk; in s3c2440_cpufreq_calcdivs() 74 armclk = cfg->freq.armclk; in s3c2440_cpufreq_calcdivs() 75 hclk_max = cfg->max.hclk; in s3c2440_cpufreq_calcdivs() [all …]
|
| H A D | s3c2410-cpufreq.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2006-2008 Simtec Electronics 19 #include <linux/soc/samsung/s3c-cpufreq-core.h> 20 #include <linux/soc/samsung/s3c-pm.h> 28 /* Note, 2410A has an extra mode for 1:4:4 ratio, bit 2 of CLKDIV */ 32 u32 clkdiv = 0; in s3c2410_cpufreq_setdivs() local 34 if (cfg->divs.h_divisor == 2) in s3c2410_cpufreq_setdivs() 35 clkdiv |= S3C2410_CLKDIVN_HDIVN; in s3c2410_cpufreq_setdivs() 37 if (cfg->divs.p_divisor != cfg->divs.h_divisor) in s3c2410_cpufreq_setdivs() 38 clkdiv |= S3C2410_CLKDIVN_PDIVN; in s3c2410_cpufreq_setdivs() [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/clock/ |
| H A D | qcom,spmi-clkdiv.txt | 1 Qualcomm Technologies, Inc. SPMI PMIC clock divider (clkdiv) 3 clkdiv configures the clock frequency of a set of outputs on the PMIC. 11 - compatible 14 Definition: must be "qcom,spmi-clkdiv". 16 - reg 18 Value type: <prop-encoded-array> 19 Definition: base address of CLKDIV peripherals. 21 - qcom,num-clkdivs 24 Definition: number of CLKDIV peripherals. 26 - clocks: [all …]
|
| H A D | renesas,emev2-smu.txt | 10 - compatible: Should be "renesas,emev2-smu" 11 - reg: Address and Size of SMU registers 21 - compatible: Should be "renesas,emev2-smu-clkdiv" 22 - reg: Byte offset from SMU base and Bit position in the register 23 - clocks: Parent clocks. Input clocks as described in clock-bindings.txt 24 - #clock-cells: Should be <0> 32 - compatible: Should be "renesas,emev2-smu-gclk" 33 - reg: Byte offset from SMU base and Bit position in the register 34 - clocks: Input clock as described in clock-bindings.txt 35 - #clock-cells: Should be <0> [all …]
|
| /OK3568_Linux_fs/kernel/drivers/spi/ |
| H A D | spi-cavium.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 26 #define OCTEON_SPI_CFG(x) (x->regs.config) 27 #define OCTEON_SPI_STS(x) (x->regs.status) 28 #define OCTEON_SPI_TX(x) (x->regs.tx) 29 #define OCTEON_SPI_DAT0(x) (x->regs.data) 46 uint64_t clkdiv:13; member 78 uint64_t clkdiv:13; 85 uint64_t clkdiv:13; member 111 uint64_t clkdiv:13; 118 uint64_t clkdiv:13; member [all …]
|
| H A D | spi-cavium.c | 14 #include "spi-cavium.h" 24 mpi_sts.u64 = readq(p->register_base + OCTEON_SPI_STS(p)); in octeon_spi_wait_ready() 33 struct spi_device *spi = msg->spi; in octeon_spi_do_transfer() 36 unsigned int clkdiv; in octeon_spi_do_transfer() local 44 mode = spi->mode; in octeon_spi_do_transfer() 48 clkdiv = p->sys_freq / (2 * xfer->speed_hz); in octeon_spi_do_transfer() 52 mpi_cfg.s.clkdiv = clkdiv; in octeon_spi_do_transfer() 60 if (spi->chip_select < 4) in octeon_spi_do_transfer() 61 p->cs_enax |= 1ull << (12 + spi->chip_select); in octeon_spi_do_transfer() 62 mpi_cfg.u64 |= p->cs_enax; in octeon_spi_do_transfer() [all …]
|
| H A D | spi-efm32.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2012-2013 Uwe Kleine-Koenig for Pengutronix 14 #include <linux/platform_data/efm32-spi.h> 17 #define DRIVER_NAME "efm32-spi" 30 #define REG_FRAME_DATABITS(n) ((n) - 3) 86 #define ddata_to_dev(ddata) (&(ddata->bitbang.master->dev)) 93 writel_relaxed(value, ddata->base + offset); in efm32_spi_write32() 98 return readl_relaxed(ddata->base + offset); in efm32_spi_read32() 104 struct efm32_spi_ddata *ddata = spi_master_get_devdata(spi->master); in efm32_spi_setup_transfer() 106 unsigned bpw = t->bits_per_word ?: spi->bits_per_word; in efm32_spi_setup_transfer() [all …]
|
| /OK3568_Linux_fs/u-boot/drivers/mmc/ |
| H A D | gen_atmel_mci.c | 4 * Reinhard Meyer, EMK Elektronik <reinhard.meyer@emk-elektronik.de> 7 * Copyright (C) 2004-2006 Atmel Corporation 9 * SPDX-License-Identifier: GPL-2.0+ 62 return readl(&mci->version) & 0x00000fff; in atmel_mci_get_version() 68 * - always when DEBUG is defined 69 * - on command errors 83 struct mmc *mmc = &plat->mmc; 84 u32 bus_hz = priv->bus_clk_rate; 85 atmel_mci_t *mci = plat->mci; 89 struct atmel_mci_priv *priv = mmc->priv; [all …]
|
| H A D | arm_pl180_mmci.c | 2 * ARM PrimeCell MultiMedia Card Interface - PL180 4 * Copyright (C) ST-Ericsson SA 2010 10 * SPDX-License-Identifier: GPL-2.0+ 25 struct pl180_mmc_host *host = dev->priv; in wait_for_command_end() 28 if ((cmd->resp_type & MMC_RSP_PRESENT)) in wait_for_command_end() 34 hoststatus = readl(&host->base->status) & statusmask; in wait_for_command_end() 37 writel(statusmask, &host->base->status_clear); in wait_for_command_end() 39 debug("CMD%d time out\n", cmd->cmdidx); in wait_for_command_end() 40 return -ETIMEDOUT; in wait_for_command_end() 42 (cmd->resp_type & MMC_RSP_CRC)) { in wait_for_command_end() [all …]
|
| /OK3568_Linux_fs/u-boot/drivers/i2c/ |
| H A D | adi_i2c.c | 2 * i2c.c - driver for ADI TWI/I2C 4 * Copyright (c) 2006-2014 Analog Devices Inc. 6 * Licensed under the GPL-2 or later. 9 * Please see doc/driver-model/i2c-howto.txt for instructions. 25 ureg(clkdiv); 66 # error "The I2C hardware can only operate 20KHz - 400KHz" 85 * wait_for_completion - manage the actual i2c transfer 94 int_stat = readw(&twi->int_stat); in wait_for_completion() 97 writew(XMTSERV, &twi->int_stat); in wait_for_completion() 98 if (msg->alen) { in wait_for_completion() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/hwtracing/intel_th/ |
| H A D | pti.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2014-2016 Intel Corporation. 27 unsigned int clkdiv; member 46 return -EINVAL; in pti_width_mode() 54 return scnprintf(buf, PAGE_SIZE, "%d\n", pti_mode[pti->mode]); in mode_show() 72 pti->mode = ret; in mode_store() 85 return scnprintf(buf, PAGE_SIZE, "%d\n", pti->freeclk); in freerunning_clock_show() 100 pti->freeclk = !!val; in freerunning_clock_store() 113 return scnprintf(buf, PAGE_SIZE, "%d\n", 1u << pti->clkdiv); in clock_divider_show() 129 return -EINVAL; in clock_divider_store() [all …]
|
| /OK3568_Linux_fs/u-boot/board/sbc8548/ |
| H A D | sbc8548.c | 10 * SPDX-License-Identifier: GPL-2.0+ 49 out_be32(&ecm->eedr, 0xffffffff); /* clear ecm errors */ in checkboard() 50 out_be32(&ecm->eeer, 0xffffffff); /* enable ecm errors */ in checkboard() 63 uint clkdiv, lbc_mhz, lcrr = CONFIG_SYS_LBC_LCRR; in local_bus_init() local 69 clkdiv = sysinfo.freq_systembus / sysinfo.freq_localbus; in local_bus_init() 71 debug("LCRR=0x%x, CD=%d, MHz=%d\n", lcrr, clkdiv, lbc_mhz); in local_bus_init() 73 out_be32(&gur->lbiuiplldcr1, 0x00078080); in local_bus_init() 74 if (clkdiv == 16) { in local_bus_init() 75 out_be32(&gur->lbiuiplldcr0, 0x7c0f1bf0); in local_bus_init() 76 } else if (clkdiv == 8) { in local_bus_init() [all …]
|
| /OK3568_Linux_fs/kernel/arch/arm/boot/dts/ |
| H A D | emev2.dtsi | 1 // SPDX-License-Identifier: GPL-2.0 8 #include <dt-bindings/interrupt-controller/arm-gic.h> 9 #include <dt-bindings/interrupt-controller/irq.h> 13 interrupt-parent = <&gic>; 14 #address-cells = <1>; 15 #size-cells = <1>; 28 #address-cells = <1>; 29 #size-cells = <0>; 33 compatible = "arm,cortex-a9"; 35 clock-frequency = <533000000>; [all …]
|
| /OK3568_Linux_fs/kernel/drivers/pwm/ |
| H A D | pwm-tiehrpwm.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright (C) 2012 Texas Instruments, Inc. - https://www.ti.com/ 145 * set_prescale_div - Set up the prescaler divider function 153 unsigned int clkdiv, hspclkdiv; in set_prescale_div() local 155 for (clkdiv = 0; clkdiv <= CLKDIV_MAX; clkdiv++) { in set_prescale_div() 161 * CLKDIVIDER = (1), if clkdiv == 0 *OR* in set_prescale_div() 162 * (2 * clkdiv), if clkdiv != 0 in set_prescale_div() 168 *prescale_div = (1 << clkdiv) * in set_prescale_div() 171 *tb_clk_div = (clkdiv << TBCTL_CLKDIV_SHIFT) | in set_prescale_div() 196 if (pc->polarity[chan] == PWM_POLARITY_INVERSED) in configure_polarity() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/w1/masters/ |
| H A D | mxc_w1.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright 2005-2008 Freescale Semiconductor, Inc. All Rights Reserved. 22 # define MXC_W1_CONTROL_WR(x) BIT(5 - (x)) 45 writeb(MXC_W1_CONTROL_RPP, dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_reset_bus() 53 u8 ctrl = readb(dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_reset_bus() 55 /* PST bit is valid after the RPP bit is self-cleared */ in mxc_w1_ds2_reset_bus() 73 writeb(MXC_W1_CONTROL_WR(bit), dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_touch_bit() 81 u8 ctrl = readb(dev->regs + MXC_W1_CONTROL); in mxc_w1_ds2_touch_bit() 83 /* RDST bit is valid after the WR1/RD bit is self-cleared */ in mxc_w1_ds2_touch_bit() 95 unsigned int clkdiv; in mxc_w1_probe() local [all …]
|
| /OK3568_Linux_fs/kernel/sound/soc/adi/ |
| H A D | axi-spdif.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2012-2013, Analog Devices Inc. 4 * Author: Lars-Peter Clausen <lars@metafoo.de> 66 return -EINVAL; in axi_spdif_trigger() 69 regmap_update_bits(spdif->regmap, AXI_SPDIF_REG_CTRL, in axi_spdif_trigger() 80 unsigned int clkdiv, stat; in axi_spdif_hw_params() local 97 clkdiv = DIV_ROUND_CLOSEST(clk_get_rate(spdif->clk_ref), in axi_spdif_hw_params() 98 rate * 64 * 2) - 1; in axi_spdif_hw_params() 99 clkdiv <<= AXI_SPDIF_CTRL_CLKDIV_OFFSET; in axi_spdif_hw_params() 101 regmap_write(spdif->regmap, AXI_SPDIF_REG_STAT, stat); in axi_spdif_hw_params() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/i2c/busses/ |
| H A D | i2c-efm32.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2014 Uwe Kleine-Koenig for Pengutronix 13 #define DRIVER_NAME "efm32-i2c" 130 return readl(ddata->base + offset); in efm32_i2c_read32() 136 writel(value, ddata->base + offset); in efm32_i2c_write32() 141 struct i2c_msg *cur_msg = &ddata->msgs[ddata->current_msg]; in efm32_i2c_send_next_msg() 149 struct i2c_msg *cur_msg = &ddata->msgs[ddata->current_msg]; in efm32_i2c_send_next_byte() 151 if (ddata->current_word >= cur_msg->len) { in efm32_i2c_send_next_byte() 153 ddata->current_word = 0; in efm32_i2c_send_next_byte() 154 ddata->current_msg += 1; in efm32_i2c_send_next_byte() [all …]
|
| /OK3568_Linux_fs/kernel/sound/soc/intel/skylake/ |
| H A D | skl-nhlt.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * skl-nhlt.c - Intel SKL Platform NHLT parsing 12 #include <sound/intel-nhlt.h> 14 #include "skl-i2s.h" 22 struct nhlt_fmt_cfg *fmt_config = fmt->fmt_config; in skl_get_specific_cfg() 25 dev_dbg(dev, "Format count =%d\n", fmt->fmt_count); in skl_get_specific_cfg() 27 for (i = 0; i < fmt->fmt_count; i++) { in skl_get_specific_cfg() 28 wfmt = &fmt_config->fmt_ext.fmt; in skl_get_specific_cfg() 29 dev_dbg(dev, "ch=%d fmt=%d s_rate=%d\n", wfmt->channels, in skl_get_specific_cfg() 30 wfmt->bits_per_sample, wfmt->samples_per_sec); in skl_get_specific_cfg() [all …]
|
| /OK3568_Linux_fs/kernel/sound/soc/codecs/ |
| H A D | adau1701.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Author: Lars-Peter Clausen <lars@metafoo.de> 100 #define ADAU1707_CLKDIV_UNSET (-1U) 192 size = adau1701_register_size(&client->dev, reg); in adau1701_reg_write() 194 return -EINVAL; in adau1701_reg_write() 199 for (i = size + 1; i >= 2; --i) { in adau1701_reg_write() 210 return -EIO; in adau1701_reg_write() 223 size = adau1701_register_size(&client->dev, reg); in adau1701_reg_read() 225 return -EINVAL; in adau1701_reg_read() 230 msgs[0].addr = client->addr; in adau1701_reg_read() [all …]
|
| /OK3568_Linux_fs/u-boot/board/freescale/mpc8548cds/ |
| H A D | mpc8548cds.c | 2 * Copyright 2004, 2007, 2009-2011 Freescale Semiconductor, Inc. 6 * SPDX-License-Identifier: GPL-2.0+ 54 gur->tsec34ioovcr = 0xe7e0; /* 1110 0111 1110 0xxx */ in checkboard() 56 ecm->eedr = 0xffffffff; /* clear ecm errors */ in checkboard() 57 ecm->eeer = 0xffffffff; /* enable ecm errors */ in checkboard() 70 uint clkdiv; in local_bus_init() local 74 clkdiv = (lbc->lcrr & LCRR_CLKDIV) * 2; in local_bus_init() 76 gur->lbiuiplldcr1 = 0x00078080; in local_bus_init() 77 if (clkdiv == 16) { in local_bus_init() 78 gur->lbiuiplldcr0 = 0x7c0f1bf0; in local_bus_init() [all …]
|
| /OK3568_Linux_fs/u-boot/board/freescale/mpc8568mds/ |
| H A D | mpc8568mds.c | 2 * Copyright 2007,2009-2011 Freescale Semiconductor, Inc. 6 * SPDX-License-Identifier: GPL-2.0+ 109 port_c->cpdir2 |= 0x0f000000; in board_early_init_f() 110 port_c->cppar2 &= ~0x0f000000; in board_early_init_f() 111 port_c->cppar2 |= 0x0a000000; in board_early_init_f() 133 uint clkdiv; in local_bus_init() local 137 clkdiv = (lbc->lcrr & LCRR_CLKDIV) * 2; in local_bus_init() 139 gur->lbiuiplldcr1 = 0x00078080; in local_bus_init() 140 if (clkdiv == 16) { in local_bus_init() 141 gur->lbiuiplldcr0 = 0x7c0f1bf0; in local_bus_init() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/gpu/drm/exynos/ |
| H A D | exynos7_drm_decon.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 30 #include "regs-decon7.h" 62 {.compatible = "samsung,exynos7-decon"}, 86 struct decon_context *ctx = crtc->ctx; in decon_wait_for_vblank() 88 if (ctx->suspended) in decon_wait_for_vblank() 91 atomic_set(&ctx->wait_vsync_event, 1); in decon_wait_for_vblank() 97 if (!wait_event_timeout(ctx->wait_vsync_queue, in decon_wait_for_vblank() 98 !atomic_read(&ctx->wait_vsync_event), in decon_wait_for_vblank() 100 DRM_DEV_DEBUG_KMS(ctx->dev, "vblank wait timed out.\n"); in decon_wait_for_vblank() 105 struct decon_context *ctx = crtc->ctx; in decon_clear_channels() [all …]
|