Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/**
* @author kangear@163.com
* @data 2014-12-17
* @param dst name num
* @return boolean
* such as:[{"name1":1, "name2":2}]
public class PrintJob {
/** total job pages */
static long mTotalPageNum;
/** finally Done job pages */
static long mDonePages;
/** Current page number */
static long mCurrentPageNum;
/** job start time */
static long mStartTime;
@kangear
kangear / ArrayAdapter.java
Created January 22, 2015 02:45
ArrayAdapter + List
package com.example.androidpro;
import java.util.ArrayList;
import java.util.List;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
@kangear
kangear / list.h
Last active August 29, 2015 14:15
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.

Linux mainline for rk3188

RK's Loader + Linux(latest) + miniroot(ext4).

###Get the source code

git clone -b stable --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
cd linux-next

wget https://raw.githubusercontent.com/naobsd/linux/naobsd/next-20150306/arch/arm/configs/rk30_rk31_defconfig -O arch/arm/configs/rockchip_defconfig
@kangear
kangear / rk_dummy.c
Last active November 13, 2018 11:06
借此Machine驱动了解了ALSA on Soc的Machine驱动。这是一个简单版本的。
/*
* rk_dummy.c -- SoC audio for rockchip
*
* Driver for rockchip dummy audio
* based: 7aca69f9fe8f04ca37a01e2540960c53b24e3223 patch
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.

##porting rk616 Audio codec driver from 3.0 version kernel to 4.0 version kernel:

  • error: 'snd_soc_info_volsw_2r' undeclared here (not in a function)
  • error: 'struct snd_soc_codec' has no member named 'mutex'
  • error: 'struct snd_soc_dapm_widget' has no member named 'codec'
  • error: 'struct snd_soc_codec' has no member named 'hw_read'
  • error: 'struct snd_soc_codec' has no member named 'read'
  • error: 'struct snd_soc_codec' has no member named 'write'

编译RK3288内核,使用arm-linux-gnueabihf出现的问题。

  OBJCOPY pie/libpie_stage2.o
  LD      pie/pie_stage2.o
arm-linux-gnueabihf-ld: BFD (GNU Binutils for Ubuntu) 2.22 internal error, aborting at ../../bfd/elflink.c line 8758 in elf_link_output_extsym

arm-linux-gnueabihf-ld: Please report this bug.

解决方法是不再使用apt-get install安装的而使用Android源码中的prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-就没有问题了。

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/input.h>
#include <linux/uinput.h>
#include <stdio.h>
#include <sys/time.h>