FreeBSD/sys/dev/drm2/radeon/radeon_device.c
/**
 * radeon_atombios_init - init the driver info and callbacks for atombios
 *
 * @rdev: radeon_device pointer
 *
 * Initializes the driver info and register access callbacks for the
 * ATOM interpreter (r4xx+).
 * Returns 0 on success, -ENOMEM on failure.
 * Called at driver startup.
 */
init the driver info and callbacks for atombios
@rdev: radeon_device pointer

Initializes the driver info and register access callbacks for the
ATOM interpreter (r4xx+).
Returns 0 on success, -ENOMEM on failure.
Called at driver startup.
init the driver info and callbacks for atombios @rdev : radeon_device pointer Initializes the driver info and register access callbacks for the ATOM interpreter ( r4xx + ) . Returns 0 on success - ENOMEM on failure . Called at driver startup .
int radeon_atombios_init(struct radeon_device *rdev)
{
	struct card_info *atom_card_info =
	    malloc(sizeof(struct card_info),
		DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
	if (!atom_card_info)
		return -ENOMEM;
	rdev->mode_info.atom_card_info = atom_card_info;
	atom_card_info->dev = rdev->ddev;
	atom_card_info->reg_read = cail_reg_read;
	atom_card_info->reg_write = cail_reg_write;
	if (rdev->rio_mem) {
		atom_card_info->ioreg_read = cail_ioreg_read;
		atom_card_info->ioreg_write = cail_ioreg_write;
	} else {
		DRM_ERROR("Unable to find PCI I/O BAR; using MMIO for ATOM IIO\n");
		atom_card_info->ioreg_read = cail_reg_read;
		atom_card_info->ioreg_write = cail_reg_write;
	}
	atom_card_info->mc_read = cail_mc_read;
	atom_card_info->mc_write = cail_mc_write;
	atom_card_info->pll_read = cail_pll_read;
	atom_card_info->pll_write = cail_pll_write;
	rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios);
	sx_init(&rdev->mode_info.atom_context->mutex,
	    "drm__radeon_device__mode_info__atom_context__mutex");
	radeon_atom_initialize_bios_scratch_regs(rdev->ddev);
	atom_allocate_fb_scratch(rdev->mode_info.atom_context);
	return 0;
}
int radeon_atombios_init ( struct radeon_device * rdev ) { struct card_info * atom_card_info = malloc ( sizeof ( struct card_info ) , DRM_MEM_DRIVER , M_NOWAIT | M_ZERO ) ; if ( ! atom_card_info ) return - ENOMEM ; rdev -> mode_info . atom_card_info = atom_card_info ; atom_card_info -> dev = rdev -> ddev ; atom_card_info -> reg_read = cail_reg_read ; atom_card_info -> reg_write = cail_reg_write ; if ( rdev -> rio_mem ) { atom_card_info -> ioreg_read = cail_ioreg_read ; atom_card_info -> ioreg_write = cail_ioreg_write ; } else { DRM_ERROR ( " \n " ) ; atom_card_info -> ioreg_read = cail_reg_read ; atom_card_info -> ioreg_write = cail_reg_write ; } atom_card_info -> mc_read = cail_mc_read ; atom_card_info -> mc_write = cail_mc_write ; atom_card_info -> pll_read = cail_pll_read ; atom_card_info -> pll_write = cail_pll_write ; rdev -> mode_info . atom_context = atom_parse ( atom_card_info , rdev -> bios ) ; sx_init ( & rdev -> mode_info . atom_context -> mutex , " " ) ; radeon_atom_initialize_bios_scratch_regs ( rdev -> ddev ) ; atom_allocate_fb_scratch ( rdev -> mode_info . atom_context ) ; return 0 ; }
radeon_atombios_init - init the driver info and callbacks for atombios
 @rdev: radeon_device pointer
radeon_atombios_init - init the driver info and callbacks for atombios @rdev : radeon_device pointer
/* needed for iio ops */