cregit-Linux how code gets into the kernel

Release 4.11 sound/pci/ctxfi/cthardware.c

Directory: sound/pci/ctxfi
/**
 * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved.
 *
 * This source file is released under GPL v2 license (no other versions).
 * See the COPYING file included in the main directory of this source
 * distribution for the license terms and conditions.
 *
 * @File        cthardware.c
 *
 * @Brief
 * This file contains the implementation of hardware access methord.
 *
 * @Author      Liu Chun
 * @Date        Jun 26 2008
 *
 */

#include "cthardware.h"
#include "cthw20k1.h"
#include "cthw20k2.h"
#include <linux/bug.h>


int create_hw_obj(struct pci_dev *pci, enum CHIPTYP chip_type, enum CTCARDS model, struct hw **rhw) { int err; switch (chip_type) { case ATC20K1: err = create_20k1_hw_obj(rhw); break; case ATC20K2: err = create_20k2_hw_obj(rhw); break; default: err = -ENODEV; break; } if (err) return err; (*rhw)->pci = pci; (*rhw)->chip_type = chip_type; (*rhw)->model = model; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Wai Yew CHAY7777.78%150.00%
Takashi Iwai2222.22%150.00%
Total99100.00%2100.00%


int destroy_hw_obj(struct hw *hw) { int err; switch (hw->pci->device) { case 0x0005: /* 20k1 device */ err = destroy_20k1_hw_obj(hw); break; case 0x000B: /* 20k2 device */ err = destroy_20k2_hw_obj(hw); break; default: err = -ENODEV; break; } return err; }

Contributors

PersonTokensPropCommitsCommitProp
Wai Yew CHAY57100.00%1100.00%
Total57100.00%1100.00%


unsigned int get_field(unsigned int data, unsigned int field) { int i; if (WARN_ON(!field)) return 0; /* @field should always be greater than 0 */ for (i = 0; !(field & (1 << i)); ) i++; return (data & field) >> i; }

Contributors

PersonTokensPropCommitsCommitProp
Wai Yew CHAY5288.14%150.00%
Takashi Iwai711.86%150.00%
Total59100.00%2100.00%


void set_field(unsigned int *data, unsigned int field, unsigned int value) { int i; if (WARN_ON(!field)) return; /* @field should always be greater than 0 */ for (i = 0; !(field & (1 << i)); ) i++; *data = (*data & (~field)) | ((value << i) & field); }

Contributors

PersonTokensPropCommitsCommitProp
Wai Yew CHAY7093.33%150.00%
Takashi Iwai56.67%150.00%
Total75100.00%2100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Wai Yew CHAY26988.78%133.33%
Takashi Iwai3411.22%266.67%
Total303100.00%3100.00%
Directory: sound/pci/ctxfi
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.