type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
includes | #include <mach/iomux-mx3.h> |
defines |
#define KZM_ARM11_IO_ADDRESS(x) (IOMEM( \ |
defines | #define KZM_ARM11_CTL1 (MX31_CS4_BASE_ADDR + 0x1000) |
defines | #define KZM_ARM11_CTL2 (MX31_CS4_BASE_ADDR + 0x1001) |
defines | #define KZM_ARM11_RSW1 (MX31_CS4_BASE_ADDR + 0x1002) |
defines | #define KZM_ARM11_BACK_LIGHT (MX31_CS4_BASE_ADDR + 0x1004) |
defines | #define KZM_ARM11_FPGA_REV (MX31_CS4_BASE_ADDR + 0x1008) |
defines | #define KZM_ARM11_7SEG_LED (MX31_CS4_BASE_ADDR + 0x1010) |
defines | #define KZM_ARM11_LEDS (MX31_CS4_BASE_ADDR + 0x1020) |
defines | #define KZM_ARM11_DIPSW2 (MX31_CS4_BASE_ADDR + 0x1003) |
defines | #define KZM_ARM11_16550 (MX31_CS4_BASE_ADDR + 0x1050) |
functions | __init kzm_init_ext_uart(void)
{
u8 tmp;
/*
* GPIO 1-1: external UART interrupt line
*/
mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO));
gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1), "ext-uart-int");
gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1));
/*
* Unmask UART interrupt
*/
tm... |
functions | int kzm_init_ext_uart(void)
{
return 0;
} |
functions | __init kzm_init_smsc9118(void)
{
/*
* GPIO 1-2: SMSC9118 interrupt line
*/
mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO));
gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int");
gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2));
regulator_register_fixed(0, dummy_supplies, ARRAY_SI... |
functions | int kzm_init_smsc9118(void)
{
return 0;
} |
functions | __init kzm_init_imx_uart(void)
{
imx31_add_imx_uart0(&uart_pdata);
imx31_add_imx_uart1(&uart_pdata);
} |
functions | void kzm_init_imx_uart(void)
{
} |
functions | __init kzm_board_init(void)
{
imx31_soc_init();
mxc_iomux_setup_multiple_pins(kzm_pins,
ARRAY_SIZE(kzm_pins), "kzm");
kzm_init_ext_uart();
kzm_init_smsc9118();
kzm_init_imx_uart();
pr_info("Clock input source is 26MHz\n");
} |
functions | __init kzm_map_io(void)
{
mx31_map_io();
iotable_init(kzm_io_desc, ARRAY_SIZE(kzm_io_desc));
} |
functions | __init kzm_timer_init(void)
{
mx31_clocks_init(26000000);
} |
includes |
#include <linux/device.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/module.h> |
includes | #include <linux/of_device.h> |
includes |
#include <linux/pci-epc.h> |
includes | #include <linux/pci-epf.h> |
includes | #include <linux/pci-ep-cfs.h> |
functions | void devm_pci_epc_release(struct device *dev, void *res)
{
struct pci_epc *epc = *(struct pci_epc **)res;
pci_epc_destroy(epc);
} |
functions | int devm_pci_epc_match(struct device *dev, void *res, void *match_data)
{
struct pci_epc **epc = res;
return *epc == match_data;
} |
functions | void pci_epc_put(struct pci_epc *epc)
{
if (!epc || IS_ERR(epc))
return;
module_put(epc->ops->owner);
put_device(&epc->dev);
} |
functions | pci_barno
pci_epc_get_first_free_bar(const struct pci_epc_features *epc_features)
{
return pci_epc_get_next_free_bar(epc_features, BAR_0);
} |
functions | pci_barno pci_epc_get_next_free_bar(const struct pci_epc_features
*epc_features, enum pci_barno bar)
{
unsigned long free_bar;
if (!epc_features)
return BAR_0;
/* If 'bar - 1' is a 64-bit BAR, move to the next BAR */
if ((epc_features->bar_fixed_64bit << 1) & 1 << bar)
bar++;
/* Find if the reserved B... |
functions | void pci_epc_stop(struct pci_epc *epc)
{
if (IS_ERR(epc) || !epc->ops->stop)
return;
mutex_lock(&epc->lock);
epc->ops->stop(epc);
mutex_unlock(&epc->lock);
} |
functions | int pci_epc_start(struct pci_epc *epc)
{
int ret;
if (IS_ERR(epc))
return -EINVAL;
if (!epc->ops->start)
return 0;
mutex_lock(&epc->lock);
ret = epc->ops->start(epc);
mutex_unlock(&epc->lock);
return ret;
} |
functions | int pci_epc_raise_irq(struct pci_epc *epc, u8 func_no,
enum pci_epc_irq_type type, u16 interrupt_num)
{
int ret;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
return -EINVAL;
if (!epc->ops->raise_irq)
return 0;
mutex_lock(&epc->lock);
ret = epc->ops->raise_irq(epc, func_no, type, interru... |
functions | int pci_epc_map_msi_irq(struct pci_epc *epc, u8 func_no, phys_addr_t phys_addr,
u8 interrupt_num, u32 entry_size, u32 *msi_data,
u32 *msi_addr_offset)
{
int ret;
if (IS_ERR_OR_NULL(epc))
return -EINVAL;
if (!epc->ops->map_msi_irq)
return -EINVAL;
mutex_lock(&epc->lock);
ret = epc->ops->map_msi_irq(epc... |
functions | int pci_epc_get_msi(struct pci_epc *epc, u8 func_no)
{
int interrupt;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
return 0;
if (!epc->ops->get_msi)
return 0;
mutex_lock(&epc->lock);
interrupt = epc->ops->get_msi(epc, func_no);
mutex_unlock(&epc->lock);
if (interrupt < 0)
return 0;
inter... |
functions | int pci_epc_set_msi(struct pci_epc *epc, u8 func_no, u8 interrupts)
{
int ret;
u8 encode_int;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions ||
interrupts > 32)
return -EINVAL;
if (!epc->ops->set_msi)
return 0;
encode_int = order_base_2(interrupts);
mutex_lock(&epc->lock);
ret = epc->ops->... |
functions | int pci_epc_get_msix(struct pci_epc *epc, u8 func_no)
{
int interrupt;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
return 0;
if (!epc->ops->get_msix)
return 0;
mutex_lock(&epc->lock);
interrupt = epc->ops->get_msix(epc, func_no);
mutex_unlock(&epc->lock);
if (interrupt < 0)
return 0;
re... |
functions | int pci_epc_set_msix(struct pci_epc *epc, u8 func_no, u16 interrupts,
enum pci_barno bir, u32 offset)
{
int ret;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions ||
interrupts < 1 || interrupts > 2048)
return -EINVAL;
if (!epc->ops->set_msix)
return 0;
mutex_lock(&epc->lock);
ret = epc->... |
functions | void pci_epc_unmap_addr(struct pci_epc *epc, u8 func_no,
phys_addr_t phys_addr)
{
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
return;
if (!epc->ops->unmap_addr)
return;
mutex_lock(&epc->lock);
epc->ops->unmap_addr(epc, func_no, phys_addr);
mutex_unlock(&epc->lock);
} |
functions | int pci_epc_map_addr(struct pci_epc *epc, u8 func_no,
phys_addr_t phys_addr, u64 pci_addr, size_t size)
{
int ret;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
return -EINVAL;
if (!epc->ops->map_addr)
return 0;
mutex_lock(&epc->lock);
ret = epc->ops->map_addr(epc, func_no, phys_addr, pci... |
functions | void pci_epc_clear_bar(struct pci_epc *epc, u8 func_no,
struct pci_epf_bar *epf_bar)
{
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions ||
(epf_bar->barno == BAR_5 &&
epf_bar->flags & PCI_BASE_ADDRESS_MEM_TYPE_64))
return;
if (!epc->ops->clear_bar)
return;
mutex_lock(&epc->lock);
e... |
functions | int pci_epc_set_bar(struct pci_epc *epc, u8 func_no,
struct pci_epf_bar *epf_bar)
{
int ret;
int flags = epf_bar->flags;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions ||
(epf_bar->barno == BAR_5 &&
flags & PCI_BASE_ADDRESS_MEM_TYPE_64) ||
(flags & PCI_BASE_ADDRESS_SPACE_IO &&
... |
functions | int pci_epc_write_header(struct pci_epc *epc, u8 func_no,
struct pci_epf_header *header)
{
int ret;
if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions)
return -EINVAL;
if (!epc->ops->write_header)
return 0;
mutex_lock(&epc->lock);
ret = epc->ops->write_header(epc, func_no, header);
mutex_unlock(&... |
functions | int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf,
enum pci_epc_interface_type type)
{
struct list_head *list;
u32 func_no;
int ret = 0;
if (IS_ERR_OR_NULL(epc))
return -EINVAL;
if (type == PRIMARY_INTERFACE && epf->epc)
return -EBUSY;
if (type == SECONDARY_INTERFACE && epf->sec_epc)
ret... |
functions | void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf,
enum pci_epc_interface_type type)
{
struct list_head *list;
u32 func_no = 0;
if (!epc || IS_ERR(epc) || !epf)
return;
if (type == PRIMARY_INTERFACE) {
func_no = epf->func_no;
list = &epf->list;
} |
functions | void pci_epc_linkup(struct pci_epc *epc)
{
if (!epc || IS_ERR(epc))
return;
atomic_notifier_call_chain(&epc->notifier, LINK_UP, NULL);
} |
functions | void pci_epc_init_notify(struct pci_epc *epc)
{
if (!epc || IS_ERR(epc))
return;
atomic_notifier_call_chain(&epc->notifier, CORE_INIT, NULL);
} |
functions | void pci_epc_destroy(struct pci_epc *epc)
{
pci_ep_cfs_remove_epc_group(epc->group);
device_unregister(&epc->dev);
kfree(epc);
} |
functions | void devm_pci_epc_destroy(struct device *dev, struct pci_epc *epc)
{
int r;
r = devres_destroy(dev, devm_pci_epc_release, devm_pci_epc_match,
epc);
dev_WARN_ONCE(dev, r, "couldn't find PCI EPC resource\n");
} |
functions | __init pci_epc_init(void)
{
pci_epc_class = class_create(THIS_MODULE, "pci_epc");
if (IS_ERR(pci_epc_class)) {
pr_err("failed to create pci epc class --> %ld\n",
PTR_ERR(pci_epc_class));
return PTR_ERR(pci_epc_class);
} |
functions | __exit pci_epc_exit(void)
{
class_destroy(pci_epc_class);
} |
defines |
#define streq(a,b) strcmp ((a), (b)) == 0 |
defines | #define strneq(a,b,n) strncmp ((a), (b), (n)) == 0 |
functions | bfd_boolean
validate_build_id_style (const char *style)
{
if ((streq (style, "md5")) || (streq (style, "sha1"))
#ifndef __MINGW32__
|| (streq (style, "uuid"))
#endif
|| (strneq (style, "0x", 2)))
return TRUE;
return FALSE;
} |
functions | bfd_size_type
compute_build_id_size (const char *style)
{
if (streq (style, "md5") || streq (style, "uuid"))
return 128 / 8;
if (streq (style, "sha1"))
return 160 / 8;
if (strneq (style, "0x", 2))
{
bfd_size_type size = 0;
/* ID is in string form (hex). Count the bytes. */
cons... |
functions | char
read_hex (const char xdigit)
{
if (ISDIGIT (xdigit))
return xdigit - '0';
if (ISUPPER (xdigit))
return xdigit - 'A' + 0xa;
if (ISLOWER (xdigit))
return xdigit - 'a' + 0xa;
abort ();
return 0;
} |
functions | bfd_boolean
generate_build_id (bfd *abfd,
const char *style,
checksum_fn checksum_contents,
unsigned char *id_bits,
int size ATTRIBUTE_UNUSED)
{
if (streq (style, "md5"))
{
struct md5_ctx ctx;
md5_init_ctx (&ctx);
if (!(*checksum_contents) (abfd, (sum_fn) &md5_process_bytes,... |
includes | #include <linux/device.h> |
includes | #include <linux/platform_device.h> |
includes | #include <linux/module.h> |
includes | #include <linux/mod_devicetable.h> |
includes | #include <linux/hid-sensor-hub.h> |
includes | #include <linux/iio/iio.h> |
includes | #include <linux/iio/buffer.h> |
structs | struct common_attributes {
int scale_pre_decml;
int scale_post_decml;
int scale_precision;
int value_offset;
}; |
structs | struct magn_3d_state {
struct hid_sensor_hub_callbacks callbacks;
struct hid_sensor_common magn_flux_attributes;
struct hid_sensor_common rot_attributes;
struct hid_sensor_hub_attribute_info magn[MAGN_3D_CHANNEL_MAX];
/* dynamically sized array to hold sensor values */
u32 *iio_vals;
/* array of pointers to sen... |
functions | void magn_3d_adjust_channel_bit_mask(struct iio_chan_spec *channels,
int channel, int size)
{
channels[channel].scan_type.sign = 's';
/* Real storage bits will change based on the report desc. */
channels[channel].scan_type.realbits = size * 8;
/* Maximum size of a sample to capture is u32 */
channels[channe... |
functions | int magn_3d_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2,
long mask)
{
struct magn_3d_state *magn_state = iio_priv(indio_dev);
int report_id = -1;
u32 address;
int ret_type;
s32 min;
*val = 0;
*val2 = 0;
switch (mask) {
case IIO_CHAN_INFO... |
functions | int magn_3d_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val,
int val2,
long mask)
{
struct magn_3d_state *magn_state = iio_priv(indio_dev);
int ret = 0;
switch (mask) {
case IIO_CHAN_INFO_SAMP_FREQ:
ret = hid_sensor_write_samp_freq_value(
... |
functions | int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
unsigned usage_id,
void *priv)
{
struct iio_dev *indio_dev = platform_get_drvdata(priv);
struct magn_3d_state *magn_state = iio_priv(indio_dev);
dev_dbg(&indio_dev->dev, "magn_3d_proc_event\n");
if (atomic_read(&magn_state->magn_flux_attributes.da... |
functions | int magn_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
unsigned usage_id,
size_t raw_len, char *raw_data,
void *priv)
{
struct iio_dev *indio_dev = platform_get_drvdata(priv);
struct magn_3d_state *magn_state = iio_priv(indio_dev);
int offset;
int ret = 0;
u32 *iio_val = NULL;
switch (usage_... |
functions | int magn_3d_parse_report(struct platform_device *pdev,
struct hid_sensor_hub_device *hsdev,
struct iio_chan_spec **channels,
int *chan_count,
unsigned usage_id,
struct magn_3d_state *st)
{
int i;
int attr_count = 0;
struct iio_chan_spec *_channels;
/* Scan for each usage attribute supported */
... |
functions | int hid_magn_3d_probe(struct platform_device *pdev)
{
int ret = 0;
static char *name = "magn_3d";
struct iio_dev *indio_dev;
struct magn_3d_state *magn_state;
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_chan_spec *channels;
int chan_count = 0;
indio_dev = devm_iio_device_alloc(&pd... |
functions | int hid_magn_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct magn_3d_state *magn_state = iio_priv(indio_dev);
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D);
iio_device_unregiste... |
includes |
#include <linux/bug.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/types.h> |
includes | #include <linux/iommu.h> |
includes | #include <linux/debugfs.h> |
includes | #include <linux/atomic.h> |
defines |
#define pr_fmt(fmt) "io-pgtable: " fmt |
functions | void free_io_pgtable_ops(struct io_pgtable_ops *ops)
{
struct io_pgtable *iop;
if (!ops)
return;
iop = container_of(ops, struct io_pgtable, ops);
io_pgtable_init_table[iop->fmt]->free(iop);
} |
functions | void io_pgtable_free_pages_exact(struct io_pgtable_cfg *cfg, void *cookie,
void *virt, size_t size)
{
if (cfg->tlb->free_pages_exact)
cfg->tlb->free_pages_exact(cookie, virt, size);
else
free_pages_exact(virt, size);
atomic_sub(1 << get_order(size), &pages_allocated);
} |
functions | int io_pgtable_init(void)
{
io_pgtable_top = debugfs_create_dir("io-pgtable", iommu_debugfs_top);
if (!io_pgtable_top)
return -ENODEV;
if (!debugfs_create_atomic_t("pages", 0600,
io_pgtable_top, &pages_allocated)) {
debugfs_remove_recursive(io_pgtable_top);
return -ENODEV;
} |
functions | void io_pgtable_exit(void)
{
debugfs_remove_recursive(io_pgtable_top);
} |
functions | HAL_StatusTypeDef HAL_HCD_Init(HCD_HandleTypeDef *hhcd)
{
/* Check the HCD handle allocation */
if(hhcd == NULL)
{
return HAL_ERROR;
} |
functions | HAL_StatusTypeDef HAL_HCD_HC_Init(HCD_HandleTypeDef *hhcd,
uint8_t ch_num,
uint8_t epnum,
uint8_t dev_address,
uint8_t speed,
uint8_t ep_type,
... |
functions | HAL_StatusTypeDef HAL_HCD_HC_Halt(HCD_HandleTypeDef *hhcd, uint8_t ch_num)
{
HAL_StatusTypeDef status = HAL_OK;
__HAL_LOCK(hhcd);
USB_HC_Halt(hhcd->Instance, ch_num);
__HAL_UNLOCK(hhcd);
return status;
} |
functions | HAL_StatusTypeDef HAL_HCD_DeInit(HCD_HandleTypeDef *hhcd)
{
/* Check the HCD handle allocation */
if(hhcd == NULL)
{
return HAL_ERROR;
} |
functions | void HAL_HCD_MspInit(HCD_HandleTypeDef *hhcd)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hhcd);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_HCD_MspInit could be implemented in the user file
*/
} |
functions | void HAL_HCD_MspDeInit(HCD_HandleTypeDef *hhcd)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hhcd);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_HCD_MspDeInit could be implemented in the user file
*/
} |
functions | HAL_StatusTypeDef HAL_HCD_HC_SubmitRequest(HCD_HandleTypeDef *hhcd,
uint8_t ch_num,
uint8_t direction ,
uint8_t ep_type,
uint8_t token,
... |
functions | void HAL_HCD_IRQHandler(HCD_HandleTypeDef *hhcd)
{
USB_OTG_GlobalTypeDef *USBx = hhcd->Instance;
uint32_t i = 0 , interrupt = 0;
/* ensure that we are in device mode */
if (USB_GetMode(hhcd->Instance) == USB_OTG_MODE_HOST)
{
/* avoid spurious interrupt */
if(__HAL_HCD_IS_INVALID_INTERRUPT(hhcd))
... |
functions | void HAL_HCD_SOF_Callback(HCD_HandleTypeDef *hhcd)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hhcd);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_HCD_SOF_Callback could be implemented in the user file
*/
} |
functions | void HAL_HCD_Connect_Callback(HCD_HandleTypeDef *hhcd)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hhcd);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_HCD_Connect_Callback could be implemented in the user file
*/
} |
functions | void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hhcd);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_HCD_Disconnect_Callback could be implemented in the user file
*/
} |
functions | void HAL_HCD_HC_NotifyURBChange_Callback(HCD_HandleTypeDef *hhcd, uint8_t chnum, HCD_URBStateTypeDef urb_state)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(hhcd);
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_HCD_HC_NotifyURBChange_Callback c... |
functions | HAL_StatusTypeDef HAL_HCD_Start(HCD_HandleTypeDef *hhcd)
{
__HAL_LOCK(hhcd);
__HAL_HCD_ENABLE(hhcd);
USB_DriveVbus(hhcd->Instance, 1);
__HAL_UNLOCK(hhcd);
return HAL_OK;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.